зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
b5ba1dcdf0
Коммит
119afd7531
7
parse.y
7
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()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче