Add an error for C-style pointer selector expressions using '->' when parsing

This commit is contained in:
gingerBill
2019-05-09 22:59:17 +01:00
parent 3fc60930e6
commit b1663a14e9

View File

@@ -2203,6 +2203,13 @@ Ast *parse_atom_expr(AstFile *f, Ast *operand, bool lhs) {
}
} break;
case Token_ArrowRight: {
Token token = advance_token(f);
syntax_error(token, "Selector expressions use '.' rather than '->'");
operand = ast_selector_expr(f, token, operand, parse_ident(f));
break;
}
case Token_OpenBracket: {
if (lhs) {
// TODO(bill): Handle this