1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use more specific warning for ambiguous slash

Fixes [Bug #17124]
This commit is contained in:
Jeremy Evans 2020-11-14 22:14:35 -08:00
parent 45fd53e0a2
commit f5bb9115a7
Notes: git 2020-11-16 08:25:59 +09:00

View file

@ -7788,7 +7788,12 @@ static int
arg_ambiguous(struct parser_params *p, char c)
{
#ifndef RIPPER
rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
if (c == '/') {
rb_warning1("ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `%c' operator", WARN_I(c));
}
else {
rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
}
#else
dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
#endif