diff --git a/src/parser.cpp b/src/parser.cpp index 70da9414d..31d41a511 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4001,6 +4001,10 @@ gb_internal Array convert_to_ident_list(AstFile *f, Array li case Ast_Ident: case Ast_BadExpr: break; + case Ast_Implicit: + syntax_error(ident, "Expected an identifier, '%.*s' which is a keyword", LIT(ident->Implicit.string)); + ident = ast_ident(f, blank_token); + break; case Ast_PolyType: if (allow_poly_names) { @@ -4014,8 +4018,9 @@ gb_internal Array convert_to_ident_list(AstFile *f, Array li } /*fallthrough*/ + default: - syntax_error(ident, "Expected an identifier"); + syntax_error(ident, "Expected an identifier, %d", ident->kind); ident = ast_ident(f, blank_token); break; }