diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-13 08:38:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-13 08:38:12 +0000 |
commit | 81798351011f8a7c1bf82e4ac195c4f2c0c23ecf (patch) | |
tree | 5559aec4c188b5f845b4f6eae2417b97e735bb10 /parse.y | |
parent | 65285fbdb898a6c19b4115ba337b4cf4298dc05f (diff) | |
download | ruby-81798351011f8a7c1bf82e4ac195c4f2c0c23ecf.tar.gz |
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.y | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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()) { |