mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-16 02:15:01 +01:00
use error tokens in parser
This commit is contained in:
parent
11b735d728
commit
62e4ffac6c
4 changed files with 243 additions and 283 deletions
|
|
@ -18,13 +18,7 @@ pub fn run_program(program: &str) {
|
|||
let ast_alloc = Bump::new();
|
||||
|
||||
let lexer = lex::Lexer::new(program);
|
||||
let ast = parse::parse(
|
||||
lexer.map(|token| match &token.kind {
|
||||
TokenType::Error(err) => Err(err.clone()),
|
||||
_ => Ok(token),
|
||||
}),
|
||||
&ast_alloc,
|
||||
);
|
||||
let ast = parse::parse(lexer, &ast_alloc);
|
||||
|
||||
match ast {
|
||||
Ok(ast) => process_ast(program, ast),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue