From d5dc032e33c149daa38e1e9b6b3cef3e580355e1 Mon Sep 17 00:00:00 2001 From: aamine Date: Fri, 26 Jul 2002 03:13:06 +0000 Subject: [PATCH] * parse.y (yylex): modify to accept a code like "m (a){...}". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ parse.y | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a0e634c8f..e7dbef55dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jul 26 12:14:48 2002 Minero Aoki + + * parse.y (yylex): modify to accept a code like "m (a){...}". + Thu Jul 25 09:05:02 2002 Nobuyoshi Nakada * misc/ruby-mode.el (ruby-delimiter): include here document. diff --git a/parse.y b/parse.y index 14e38347cf..2ca171f332 100644 --- a/parse.y +++ b/parse.y @@ -3850,12 +3850,12 @@ yylex() return c; case '{': - if (!IS_ARG()) { - if (space_seen && lex_state == EXPR_ENDARG) - c = tLBRACE_ARG; - if (lex_state != EXPR_END && lex_state != EXPR_ENDARG) - c = tLBRACE; - } + if (IS_ARG() || lex_state == EXPR_END) + c = '{'; /* block (primary) */ + else if (lex_state == EXPR_ENDARG) + c = tLBRACE_ARG; /* block (expr) */ + else + c = tLBRACE; /* hash */ COND_PUSH(0); CMDARG_PUSH(0); lex_state = EXPR_BEG;