diff options
author | Jeremy Evans <[email protected]> | 2020-11-14 22:14:35 -0800 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2020-11-15 15:25:32 -0800 |
commit | f5bb9115a7f69c32089b9b970933c3507fb9f82b (patch) | |
tree | 14f288e98071003bb01a8b6da8679b37075279cc /parse.y | |
parent | 45fd53e0a22a2e3a870181cc2bfc74abcc5cac79 (diff) |
Use more specific warning for ambiguous slash
Fixes [Bug #17124]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3767
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |