]> Repositories - zlox.git/blobdiff - src/Parser.zig
Implement interpreter
[zlox.git] / src / Parser.zig
index bcc6ee69ec721ae945afc0a56d667ec54dba8174..7b5a3117d0a17f7383565223dae824dca0cf7dbd 100644 (file)
@@ -27,9 +27,9 @@ pub fn deinit(self: *Parser) void {
 pub fn parse(self: *Parser) !?*Expr {
     self.allocator = self.arena.allocator();
 
 pub fn parse(self: *Parser) !?*Expr {
     self.allocator = self.arena.allocator();
 
-    return self.expression() catch |err| switch (err) {
+    return self.expression() catch |err2| switch (err2) {
         error.ParseError => return null,
         error.ParseError => return null,
-        else => return err,
+        else => return err2,
     };
 }
 
     };
 }
 
@@ -102,7 +102,7 @@ fn unary(self: *Parser) !*Expr {
         return expr;
     }
 
         return expr;
     }
 
-    return try self.primary();
+    return self.primary();
 }
 
 fn primary(self: *Parser) !*Expr {
 }
 
 fn primary(self: *Parser) !*Expr {