diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-01 06:59:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-01 06:59:43 +0000 |
commit | 119afd7531fd175dacb80948cfc1f581b721d47e (patch) | |
tree | 3c4c2fd0239fcaa776dd56715e9dac8702b3750f /parse.y | |
parent | b5ba1dcdf0d0db9dc1cdbbc9710e9cab4a6f3bab (diff) | |
download | ruby-119afd7531fd175dacb80948cfc1f581b721d47e.tar.gz |
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.y | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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()) { |