aboutsummaryrefslogtreecommitdiff
path: root/src/parse.zig
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-06-02 21:13:20 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-06-02 21:13:20 +0200
commit1b43beffd49d1d3dd5679c54a84ecff304d53d84 (patch)
tree58a7dde08737c91ea92b2c8022b845ae7d7f8d46 /src/parse.zig
parent5cf5cb8fbf3c53d28c40cb682d5a3bf3db583922 (diff)
downloadhuginn-1b43beffd49d1d3dd5679c54a84ecff304d53d84.tar.gz
stop printing non-existant errors
Diffstat (limited to 'src/parse.zig')
-rw-r--r--src/parse.zig6
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;
}