diff options
author | Mathias Magnusson <mathias@magnusson.space> | 2025-06-02 21:13:20 +0200 |
---|---|---|
committer | Mathias Magnusson <mathias@magnusson.space> | 2025-06-02 21:13:20 +0200 |
commit | 1b43beffd49d1d3dd5679c54a84ecff304d53d84 (patch) | |
tree | 58a7dde08737c91ea92b2c8022b845ae7d7f8d46 | |
parent | 5cf5cb8fbf3c53d28c40cb682d5a3bf3db583922 (diff) | |
download | huginn-1b43beffd49d1d3dd5679c54a84ecff304d53d84.tar.gz |
stop printing non-existant errors
-rw-r--r-- | src/parse.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/parse.zig b/src/parse.zig index 08dcc81..6ed1b79 100644 --- a/src/parse.zig +++ b/src/parse.zig @@ -179,8 +179,10 @@ pub fn parsePrimaryExpr(allocator: Allocator, lexer: *Lexer) !*Expr { fn mustEat(lexer: *Lexer, ty: Lexer.Token.Type) !Lexer.Token { const token = lexer.next(); - std.debug.print("Expected {}. Got {}\n", .{ ty, token.type }); - if (token.type != ty) return error.UnexpectedToken; + if (token.type != ty) { + std.debug.print("Expected {}. Got {}\n", .{ ty, token.type }); + return error.UnexpectedToken; + } return token; } |