summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-01 06:59:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-01 06:59:43 +0000
commit119afd7531fd175dacb80948cfc1f581b721d47e (patch)
tree3c4c2fd0239fcaa776dd56715e9dac8702b3750f /parse.y
parentb5ba1dcdf0d0db9dc1cdbbc9710e9cab4a6f3bab (diff)
parse.y: separate error messages
* parse.y (parse_atmark): separate error messages for sigil types, and make more descriptive git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index d707a1bd04..18c08db394 100644
--- a/parse.y
+++ b/parse.y
@@ -7576,7 +7576,12 @@ parse_atmark(struct parser_params *parser, const enum lex_state_e last_state)
c = nextc();
}
if (c == -1 || ISSPACE(c)) {
- compile_error(PARSER_ARG "unexpected @");
+ if (result == tIVAR) {
+ compile_error(PARSER_ARG "`@' without identifiers is not allowed as an instance variable name");
+ }
+ else {
+ compile_error(PARSER_ARG "`@@' without identifiers is not allowed as a class variable name");
+ }
return 0;
}
else if (ISDIGIT(c) || !parser_is_identchar()) {