diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-06 02:08:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-06 02:08:45 +0000 |
commit | 3fd37d082402858facc7e0b4c8847f113394659f (patch) | |
tree | 7a42e2a955858b01ae82e1f7519c17415ddc48bb /parse.y | |
parent | f0ee1e67d3ef36e9b5d18d6c52a4645ea3f6b9c6 (diff) | |
download | ruby-3fd37d082402858facc7e0b4c8847f113394659f.tar.gz |
parse.y: fix warning message
* parse.y (arg_ambiguous_gen): fix warning message, "even" does
not mean the number of spaces here. state the place to put a
space and the operator. [ruby-core:64790] [Bug #10204]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -6588,15 +6588,15 @@ parser_here_document(struct parser_params *parser, NODE *here) #include "lex.c" static void -arg_ambiguous_gen(struct parser_params *parser) +arg_ambiguous_gen(struct parser_params *parser, char c) { #ifndef RIPPER - rb_warning0("ambiguous first argument; put parentheses or even spaces"); + rb_warningS("ambiguous first argument; put parentheses or a space even after `%c' operator", c); #else - dispatch0(arg_ambiguous); + dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1)); #endif } -#define arg_ambiguous() (arg_ambiguous_gen(parser), 1) +#define arg_ambiguous(c) (arg_ambiguous_gen(parser, (c)), 1) static ID formal_argument_gen(struct parser_params *parser, ID lhs) @@ -8012,7 +8012,7 @@ parser_yylex(struct parser_params *parser) lex_state = EXPR_BEG; return tOP_ASGN; } - if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { + if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous('+'))) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { @@ -8044,7 +8044,7 @@ parser_yylex(struct parser_params *parser) lex_state = EXPR_ENDFN; return tLAMBDA; } - if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { + if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous('-'))) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { @@ -8134,7 +8134,7 @@ parser_yylex(struct parser_params *parser) } pushback(c); if (IS_SPCARG(c)) { - (void)arg_ambiguous(); + (void)arg_ambiguous('/'); lex_strterm = NEW_STRTERM(str_regexp, '/', 0); return tREGEXP_BEG; } |