use error tokens in parser

This commit is contained in:
nora 2021-12-30 16:46:41 +01:00
parent 11b735d728
commit 62e4ffac6c
4 changed files with 243 additions and 283 deletions

View file

@ -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),