X-Git-Url: https://git.ayoreis.com/zlox.git/blobdiff_plain/6d286699938880d7a1482be65e5e4771788c6b6f..7f37f7b365d59acf06be1092a3323b60cce2b750:/src/Parser.zig?ds=inline diff --git a/src/Parser.zig b/src/Parser.zig index a584c3f..bcc6ee6 100644 --- a/src/Parser.zig +++ b/src/Parser.zig @@ -138,7 +138,7 @@ fn primary(self: *Parser) !*Expr { return grouping; } - try self.@"error"(self.peek(), "Expect expression."); + try self.err(self.peek(), "Expect expression."); } 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(); - try self.@"error"(self.peek(), message); + try self.err(self.peek(), message); } fn check(self: *Parser, @"type": TokenType) bool { @@ -180,8 +180,8 @@ fn previous(self: *Parser) Token { 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; }