diff options
| author | gingerBill <bill@gingerbill.org> | 2019-05-09 22:59:17 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-05-09 22:59:17 +0100 |
| commit | b1663a14e99b1892f625d182a5bf6c458c7785b2 (patch) | |
| tree | 0a585d7b29d789f80dec3d89d74efe5b54bf56c8 /src/parser.cpp | |
| parent | 3fc60930e6c18924a7d38b81fd50ee4379f94b62 (diff) | |
Add an error for C-style pointer selector expressions using '->' when parsing
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 5e987d886..0d70f4a5c 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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 |