Improve parser error handling
This commit is contained in:
parent
7236c0b43a
commit
cb5d7c7798
3 changed files with 42 additions and 10 deletions
|
|
@ -67,8 +67,10 @@ fn run(allocator: std.mem.Allocator, bytes: []u8) !void {
|
|||
.allocator = alloc,
|
||||
};
|
||||
|
||||
const expression = try parse.expression();
|
||||
// std.debug.print("AST: {}", .{expression.*});
|
||||
expr.AstPrint(expression.*);
|
||||
const expression = parse.parse();
|
||||
if (err.hasError) {
|
||||
return;
|
||||
}
|
||||
expr.AstPrint(expression);
|
||||
std.debug.print("\n", .{});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue