summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-13 08:38:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-13 08:38:12 +0000
commit81798351011f8a7c1bf82e4ac195c4f2c0c23ecf (patch)
tree5559aec4c188b5f845b4f6eae2417b97e735bb10 /parse.y
parent65285fbdb898a6c19b4115ba337b4cf4298dc05f (diff)
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
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 0da381d758..01f0c9a64c 100644
--- a/parse.y
+++ b/parse.y
@@ -8147,7 +8147,12 @@ parser_yylex(struct parser_params *parser)
}
pushback(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;
}
else if (IS_BEG()) {