mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Give a better error message when the user uses context as if it was an identifier in a field list.
This commit is contained in:
+6
-1
@@ -4001,6 +4001,10 @@ gb_internal Array<Ast *> convert_to_ident_list(AstFile *f, Array<AstAndFlags> li
|
|||||||
case Ast_Ident:
|
case Ast_Ident:
|
||||||
case Ast_BadExpr:
|
case Ast_BadExpr:
|
||||||
break;
|
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:
|
case Ast_PolyType:
|
||||||
if (allow_poly_names) {
|
if (allow_poly_names) {
|
||||||
@@ -4014,8 +4018,9 @@ gb_internal Array<Ast *> convert_to_ident_list(AstFile *f, Array<AstAndFlags> li
|
|||||||
}
|
}
|
||||||
/*fallthrough*/
|
/*fallthrough*/
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
syntax_error(ident, "Expected an identifier");
|
syntax_error(ident, "Expected an identifier, %d", ident->kind);
|
||||||
ident = ast_ident(f, blank_token);
|
ident = ast_ident(f, blank_token);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user