mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: relax `&' warning
* parse.y (parser_yylex): disable "`&' interpreted as argument prefix" warning when just followed by a symbol literal. [ruby-core:79926] [Misc #13283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65285fbdb8
commit
8179835101
1 changed files with 6 additions and 1 deletions
7
parse.y
7
parse.y
|
@ -8147,7 +8147,12 @@ parser_yylex(struct parser_params *parser)
|
||||||
}
|
}
|
||||||
pushback(c);
|
pushback(c);
|
||||||
if (IS_SPCARG(c)) {
|
if (IS_SPCARG(c)) {
|
||||||
rb_warning0("`&' interpreted as argument prefix");
|
if ((c != ':') ||
|
||||||
|
(c = peekc_n(1)) == -1 ||
|
||||||
|
!(c == '\'' || c == '"' ||
|
||||||
|
is_identchar((lex_p+1), lex_pend, current_enc))) {
|
||||||
|
rb_warning0("`&' interpreted as argument prefix");
|
||||||
|
}
|
||||||
c = tAMPER;
|
c = tAMPER;
|
||||||
}
|
}
|
||||||
else if (IS_BEG()) {
|
else if (IS_BEG()) {
|
||||||
|
|
Loading…
Reference in a new issue