summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 6d04f4175e..d707a1bd04 100644
--- a/parse.y
+++ b/parse.y
@@ -7575,9 +7575,13 @@ parse_atmark(struct parser_params *parser, const enum lex_state_e last_state)
tokadd('@');
c = nextc();
}
- if (c != -1 && (ISDIGIT(c) || !parser_is_identchar())) {
+ if (c == -1 || ISSPACE(c)) {
+ compile_error(PARSER_ARG "unexpected @");
+ return 0;
+ }
+ else if (ISDIGIT(c) || !parser_is_identchar()) {
pushback(c);
- if (tokidx == 1) {
+ if (result == tIVAR) {
compile_error(PARSER_ARG "`@%c' is not allowed as an instance variable name", c);
}
else {