ruby-changes:10144
From: matz <ko1@a...>
Date: Tue, 20 Jan 2009 18:37:51 +0900 (JST)
Subject: [ruby-changes:10144] Ruby:r21688 (ruby_1_8): * parse.y (IS_BEG): EXPR_CLASS should be treated like EXPR_BEG.
matz 2009-01-20 18:37:40 +0900 (Tue, 20 Jan 2009) New Revision: 21688 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21688 Log: * parse.y (IS_BEG): EXPR_CLASS should be treated like EXPR_BEG. [ruby-core:21453] Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/parse.y Index: ruby_1_8/parse.y =================================================================== --- ruby_1_8/parse.y (revision 21687) +++ ruby_1_8/parse.y (revision 21688) @@ -3434,6 +3434,7 @@ } #define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG) +#define IS_BEG() (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_CLASS) static int yylex() @@ -3519,7 +3520,7 @@ rb_warning("`*' interpreted as argument prefix"); c = tSTAR; } - else if (lex_state == EXPR_BEG || lex_state == EXPR_MID) { + else if (IS_BEG()) { c = tSTAR; } else { @@ -3748,7 +3749,7 @@ rb_warning("`&' interpreted as argument prefix"); c = tAMPER; } - else if (lex_state == EXPR_BEG || lex_state == EXPR_MID) { + else if (IS_BEG()) { c = tAMPER; } else { @@ -3802,7 +3803,7 @@ lex_state = EXPR_BEG; return tOP_ASGN; } - if (lex_state == EXPR_BEG || lex_state == EXPR_MID || + if (IS_BEG() || (IS_ARG() && space_seen && !ISSPACE(c))) { if (IS_ARG()) arg_ambiguous(); lex_state = EXPR_BEG; @@ -3832,7 +3833,7 @@ lex_state = EXPR_BEG; return tOP_ASGN; } - if (lex_state == EXPR_BEG || lex_state == EXPR_MID || + if (IS_BEG() || (IS_ARG() && space_seen && !ISSPACE(c))) { if (IS_ARG()) arg_ambiguous(); lex_state = EXPR_BEG; @@ -4093,8 +4094,7 @@ case ':': c = nextc(); if (c == ':') { - if (lex_state == EXPR_BEG || lex_state == EXPR_MID || - lex_state == EXPR_CLASS || (IS_ARG() && space_seen)) { + if (IS_BEG() || (IS_ARG() && space_seen)) { lex_state = EXPR_BEG; return tCOLON3; } @@ -4121,7 +4121,7 @@ return tSYMBEG; case '/': - if (lex_state == EXPR_BEG || lex_state == EXPR_MID) { + if (IS_BEG()) { lex_strterm = NEW_STRTERM(str_regexp, '/', 0); return tREGEXP_BEG; } @@ -4183,7 +4183,7 @@ case '(': command_start = Qtrue; - if (lex_state == EXPR_BEG || lex_state == EXPR_MID) { + if (IS_BEG()) { c = tLPAREN; } else if (space_seen) { @@ -4213,7 +4213,7 @@ pushback(c); return '['; } - else if (lex_state == EXPR_BEG || lex_state == EXPR_MID) { + else if (IS_BEG()) { c = tLBRACK; } else if (IS_ARG() && space_seen) { @@ -4247,7 +4247,7 @@ return '\\'; case '%': - if (lex_state == EXPR_BEG || lex_state == EXPR_MID) { + if (IS_BEG()) { int term; int paren; @@ -4561,6 +4561,7 @@ lex_state == EXPR_MID || lex_state == EXPR_DOT || lex_state == EXPR_ARG || + lex_state == EXPR_CLASS || lex_state == EXPR_CMDARG) { if (cmd_state) { lex_state = EXPR_CMDARG; Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 21687) +++ ruby_1_8/ChangeLog (revision 21688) @@ -1,3 +1,8 @@ +Tue Jan 20 18:30:57 2009 Yukihiro Matsumoto <matz@r...> + + * parse.y (IS_BEG): EXPR_CLASS should be treated like EXPR_BEG. + [ruby-core:21453] + Tue Jan 20 04:02:44 2009 Nobuyoshi Nakada <nobu@r...> * node.h (rb_thread_raised_clear): should not clear flags other than -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/