ruby-changes:8244
From: matz <ko1@a...>
Date: Tue, 14 Oct 2008 09:42:42 +0900 (JST)
Subject: [ruby-changes:8244] Ruby:r19771 (trunk): * parse.y (parser_yylex): allow reserved word to be keyword argument.
matz 2008-10-14 09:36:52 +0900 (Tue, 14 Oct 2008) New Revision: 19771 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19771 Log: * parse.y (parser_yylex): allow reserved word to be keyword argument. Modified files: trunk/ChangeLog trunk/parse.y Index: ChangeLog =================================================================== --- ChangeLog (revision 19770) +++ ChangeLog (revision 19771) @@ -1,3 +1,7 @@ +Tue Oct 14 08:28:31 2008 Yukihiro Matsumoto <matz@r...> + + * parse.y (parser_yylex): allow reserved word to be keyword argument. + Mon Oct 13 19:07:52 2008 NARUSE, Yui <naruse@r...> * parse.y (token_info_pop): show source filename. [ruby-dev:36710] Index: parse.y =================================================================== --- parse.y (revision 19770) +++ parse.y (revision 19771) @@ -7523,6 +7523,16 @@ } } + if ((lex_state == EXPR_BEG && !cmd_state) || + lex_state == EXPR_ARG || + lex_state == EXPR_CMDARG) { + if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) { + lex_state = EXPR_BEG; + nextc(); + set_yylval_id(TOK_INTERN(!ENC_SINGLE(mb))); + return tLABEL; + } + } if (mb == ENC_CODERANGE_7BIT && lex_state != EXPR_DOT) { const struct kwtable *kw; @@ -7559,16 +7569,6 @@ } } - if ((lex_state == EXPR_BEG && !cmd_state) || - lex_state == EXPR_ARG || - lex_state == EXPR_CMDARG) { - if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) { - lex_state = EXPR_BEG; - nextc(); - set_yylval_id(TOK_INTERN(!ENC_SINGLE(mb))); - return tLABEL; - } - } if (IS_BEG() || lex_state == EXPR_DOT || IS_ARG()) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/