diff --git a/ChangeLog b/ChangeLog index 60aaa33ae5..2370cd14b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Apr 19 19:18:53 2010 Nobuyoshi Nakada + + * parse.y (parser_yylex): reduced duplicated conditions. + Mon Apr 19 13:58:04 2010 Eric Hodel * lib/rdoc: Update to RDoc 2.5.4. Fixes #3169, #3160, #3023. diff --git a/parse.y b/parse.y index 77f3e0a4f1..0ba786c939 100644 --- a/parse.y +++ b/parse.y @@ -6117,7 +6117,7 @@ arg_ambiguous_gen(struct parser_params *parser) dispatch0(arg_ambiguous); #endif } -#define arg_ambiguous() arg_ambiguous_gen(parser) +#define arg_ambiguous() (arg_ambiguous_gen(parser), 1) static ID formal_argument_gen(struct parser_params *parser, ID lhs) @@ -6886,8 +6886,7 @@ parser_yylex(struct parser_params *parser) lex_state = EXPR_BEG; return tOP_ASGN; } - if (IS_BEG() || IS_SPCARG(c)) { - if (!IS_BEG()) arg_ambiguous(); + if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { @@ -6919,8 +6918,7 @@ parser_yylex(struct parser_params *parser) lex_state = EXPR_ARG; return tLAMBDA; } - if (IS_BEG() || IS_SPCARG(c)) { - if (!IS_BEG()) arg_ambiguous(); + if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) {