]> Repositories - zlox.git/blobdiff - src/Parser.zig
Rename error functions
[zlox.git] / src / Parser.zig
index a584c3ff71f7eebcb5abba1c60a106d43fba5311..bcc6ee69ec721ae945afc0a56d667ec54dba8174 100644 (file)
@@ -138,7 +138,7 @@ fn primary(self: *Parser) !*Expr {
         return grouping;
     }
 
         return grouping;
     }
 
-    try self.@"error"(self.peek(), "Expect expression.");
+    try self.err(self.peek(), "Expect expression.");
 }
 
 fn match(self: *Parser, types: []const TokenType) bool {
 }
 
 fn match(self: *Parser, types: []const TokenType) bool {
@@ -155,7 +155,7 @@ fn match(self: *Parser, types: []const TokenType) bool {
 fn consume(self: *Parser, @"type": TokenType, message: []const u8) !Token {
     if (self.check(@"type")) return self.advance();
 
 fn consume(self: *Parser, @"type": TokenType, message: []const u8) !Token {
     if (self.check(@"type")) return self.advance();
 
-    try self.@"error"(self.peek(), message);
+    try self.err(self.peek(), message);
 }
 
 fn check(self: *Parser, @"type": TokenType) bool {
 }
 
 fn check(self: *Parser, @"type": TokenType) bool {
@@ -180,8 +180,8 @@ fn previous(self: *Parser) Token {
     return self.tokens[self.current - 1];
 }
 
     return self.tokens[self.current - 1];
 }
 
-fn @"error"(self: *Parser, token: Token, message: []const u8) !noreturn {
-    try lox.parse_error(self.allocator, token, message);
+fn err(self: *Parser, token: Token, message: []const u8) !noreturn {
+    try lox.parseError(self.allocator, token, message);
     return error.ParseError;
 }
 
     return error.ParseError;
 }