From 639bd5e78fa7d83b44c892afccb99869a886e533 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 30 Jun 2005 06:20:09 +0000 Subject: * eval.c (rb_eval): pre-evaluate argument for unambiguous evaluation order. [ruby-dev:26383] * lib/delegate.rb (Delegator::method_missing): forward unknown method to the destination. suggested by . [ruby-talk:146776] * process.c (detach_process_watcher): terminate process watcher thread right after rb_waitpid() succeed. [ruby-talk:146430] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index ee0444d7da..ffd1b18323 100644 --- a/parse.y +++ b/parse.y @@ -56,6 +56,7 @@ int ruby_sourceline; /* current line no. */ enum lex_state_e { EXPR_BEG, /* ignore newline, +/- is a sign. */ EXPR_END, /* newline significant, +/- is a operator. */ + EXPR_END2, /* newline significant, +/- is a operator. */ EXPR_ARG, /* newline significant, +/- is a operator. */ EXPR_CMDARG, /* newline significant, +/- is a operator. */ EXPR_ENDARG, /* newline significant, +/- is a operator. */ @@ -5725,6 +5726,7 @@ parser_yylex(parser) c = nextc(); if (c == '<' && lex_state != EXPR_END && + lex_state != EXPR_END2 && lex_state != EXPR_DOT && lex_state != EXPR_ENDARG && lex_state != EXPR_CLASS && @@ -5803,7 +5805,9 @@ parser_yylex(parser) return tSTRING_BEG; case '?': - if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) { + if (lex_state == EXPR_END || + lex_state == EXPR_END2 || + lex_state == EXPR_ENDARG) { lex_state = EXPR_VALUE; return '?'; } @@ -6232,7 +6236,8 @@ parser_yylex(parser) 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_END2 || + lex_state == EXPR_ENDARG || ISSPACE(c)) { pushback(c); lex_state = EXPR_BEG; return ':'; @@ -6293,11 +6298,10 @@ parser_yylex(parser) return '^'; case ';': - if ((c = nextc()) == ';') { - lex_state = EXPR_END; + if (lex_state != EXPR_END2 && peek(';')) { + lex_state = EXPR_END2; return kEND; } - pushback(c); lex_state = EXPR_BEG; command_start = Qtrue; return ';'; @@ -6363,7 +6367,7 @@ parser_yylex(parser) return c; case '{': - if (IS_ARG() || lex_state == EXPR_END) + if (IS_ARG() || lex_state == EXPR_END || lex_state == EXPR_END2) c = '{'; /* block (primary) */ else if (lex_state == EXPR_ENDARG) c = tLBRACE_ARG; /* block (expr) */ -- cgit v1.2.3