ruby-changes:7676
From: matz <ko1@a...>
Date: Sun, 7 Sep 2008 01:09:58 +0900 (JST)
Subject: [ruby-changes:7676] Ruby:r19197 (trunk): * parse.y (yylex): "1.upto 2 {|i| p i }" should be syntax error.
matz 2008-09-07 01:09:43 +0900 (Sun, 07 Sep 2008) New Revision: 19197 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19197 Log: * parse.y (yylex): "1.upto 2 {|i| p i }" should be syntax error. [ruby-dev:36008] Modified files: trunk/ChangeLog trunk/parse.y Index: ChangeLog =================================================================== --- ChangeLog (revision 19196) +++ ChangeLog (revision 19197) @@ -1,3 +1,8 @@ +Sun Sep 7 01:07:10 2008 Yukihiro Matsumoto <matz@r...> + + * parse.y (yylex): "1.upto 2 {|i| p i }" should be syntax error. + [ruby-dev:36008] + Sun Sep 7 00:37:25 2008 Tanaka Akira <akr@f...> * include/ruby/encoding.h (ECONV_ERROR_HANDLER_MASK): defined. Index: parse.y =================================================================== --- parse.y (revision 19196) +++ parse.y (revision 19197) @@ -3955,10 +3955,10 @@ symbol : tSYMBEG sym { /*%%%*/ - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; $$ = $2; /*% - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; $$ = dispatch1(symbol, $2); %*/ } @@ -3973,7 +3973,7 @@ dsym : tSYMBEG xstring_contents tSTRING_END { /*%%%*/ - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; if (!($$ = $2)) { $$ = NEW_LIT(ID2SYM(rb_intern(""))); } @@ -3995,7 +3995,7 @@ } } /*% - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; $$ = dispatch1(dyna_symbol, $2); %*/ } @@ -6191,7 +6191,7 @@ token = here_document(lex_strterm); if (token == tSTRING_END) { lex_strterm = 0; - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; } } else { @@ -6199,7 +6199,7 @@ if (token == tSTRING_END || token == tREGEXP_END) { rb_gc_force_recycle((VALUE)lex_strterm); lex_strterm = 0; - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; } } return token; @@ -6493,8 +6493,7 @@ return tSTRING_BEG; case '?': - if (lex_state == EXPR_END || - lex_state == EXPR_ENDARG) { + if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) { lex_state = EXPR_VALUE; return '?'; } @@ -6565,7 +6564,7 @@ } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0)); - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; return tCHAR; case '&': @@ -6714,7 +6713,7 @@ int is_float, seen_point, seen_e, nondigit; is_float = seen_point = seen_e = nondigit = 0; - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; newtok(); if (c == '-' || c == '+') { tokadd(c); @@ -6950,8 +6949,7 @@ lex_state = EXPR_DOT; return tCOLON2; } - if (lex_state == EXPR_END || - lex_state == EXPR_ENDARG || ISSPACE(c)) { + if (lex_state == EXPR_END || lex_state == EXPR_ENDARG || ISSPACE(c)) { pushback(c); lex_state = EXPR_BEG; return ':'; @@ -7190,7 +7188,7 @@ case '$': last_state = lex_state; - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; newtok(); c = nextc(); switch (c) { @@ -7351,11 +7349,11 @@ last_state = lex_state; switch (tok()[0]) { case '$': - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; result = tGVAR; break; case '@': - lex_state = EXPR_ENDARG; + lex_state = EXPR_END; if (tok()[1] == '@') result = tCVAR; else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/