luaur-ast 0.1.3

Lexer, parser, and AST for Luau (faithful Rust port).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::records::ast_stat_block::AstStatBlock;
use crate::records::lexeme::Type;
use crate::records::parser::Parser;

impl Parser {
    pub fn parse_chunk(&mut self) -> *mut AstStatBlock {
        let result = self.parse_block();

        if self.lexer.current().r#type != Type::Eof {
            self.expect_and_consume_fail(Type::Eof, "");
        }

        result
    }
}