Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify parsing Lua version #263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt;

use full_moon::ast::Ast;
use full_moon::{ast::Ast, LuaVersion};

use crate::{
ast_converter::{AstConverter, ConvertError},
Expand All @@ -16,7 +16,7 @@ pub struct Parser {
impl Parser {
pub fn parse(&self, code: &str) -> Result<Block, ParserError> {
let full_moon_parse_timer = Timer::now();
let parse_result = full_moon::parse(code);
let parse_result = full_moon::parse_fallible(code, LuaVersion::luau()).into_result();
log::trace!(
"full-moon parsing done in {}",
full_moon_parse_timer.duration_label()
Expand Down Expand Up @@ -526,7 +526,7 @@ mod test {
"failed to parse `{}`: {}\nfull-moon result:\n{:#?}",
$input,
err,
full_moon::parse($input)
full_moon::parse_fallible($input, LuaVersion::luau()).into_result()
);
}
};
Expand Down
Loading