aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
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 4d9ca70104..27da6bdcf9 100644
--- a/parse.y
+++ b/parse.y
@@ -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