From a97ba8c7f7a497d70c9c285b4bf223a79d940935 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 25 Jun 2002 09:56:36 +0000 Subject: [PATCH] * parse.y (string1, xstring, regexp): moved lex_strnest initialization to string_contents/xstring_contents. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ parse.y | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74ef889146..81566bc20b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 25 18:53:34 2002 Nobuyoshi Nakada + + * parse.y (string1, xstring, regexp): moved lex_strnest + initialization to string_contents/xstring_contents. + Tue Jun 25 19:24:38 2002 KONISHI Hiromasa * dln.c: remove definition rb_loaderror(). diff --git a/parse.y b/parse.y index e21eae0c22..103974be97 100644 --- a/parse.y +++ b/parse.y @@ -1787,15 +1787,15 @@ string : string1 } ; -string1 : tSTRING_BEG {lex_strnest = 0;} string_contents tSTRING_END +string1 : tSTRING_BEG string_contents tSTRING_END { - $$ = $3; + $$ = $2; } ; -xstring : tXSTRING_BEG {lex_strnest = 0;} xstring_contents tSTRING_END +xstring : tXSTRING_BEG xstring_contents tSTRING_END { - NODE *node = $3; + NODE *node = $2; if (!node) { node = NEW_XSTR(rb_str_new(0, 0)); } @@ -1808,8 +1808,8 @@ xstring : tXSTRING_BEG {lex_strnest = 0;} xstring_contents tSTRING_END nd_set_type(node, NODE_DXSTR); break; default: - node = rb_node_newnode(NODE_DXSTR, - rb_str_new(0, 0), 1, NEW_LIST(node)); + node = rb_node_newnode(NODE_DXSTR, rb_str_new(0, 0), + 1, NEW_LIST(node)); break; } } @@ -1817,10 +1817,10 @@ xstring : tXSTRING_BEG {lex_strnest = 0;} xstring_contents tSTRING_END } ; -regexp : tREGEXP_BEG {lex_strnest = 0;} xstring_contents tREGEXP_END +regexp : tREGEXP_BEG xstring_contents tREGEXP_END { - int options = $4; - NODE *node = $3; + int options = $3; + NODE *node = $2; if (!node) { node = NEW_LIT(rb_reg_new("", 0, options & ~RE_OPTION_ONCE)); } @@ -1853,6 +1853,7 @@ regexp : tREGEXP_BEG {lex_strnest = 0;} xstring_contents tREGEXP_END string_contents : /* none */ { + lex_strnest = 0; $$ = 0; } | string_contents string_content @@ -1863,6 +1864,7 @@ string_contents : /* none */ xstring_contents: /* none */ { + lex_strnest = 0; $$ = 0; } | xstring_contents string_content @@ -1910,7 +1912,7 @@ string_dvar : tGVAR {$$ = NEW_GVAR($1);} | backref ; -term_push : /* */ +term_push : /* none */ { if (($$ = quoted_term) == -1 && nd_type(lex_strterm) == NODE_STRTERM &&