diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 22 |
2 files changed, 17 insertions, 10 deletions
@@ -1,3 +1,8 @@ +Tue Jun 25 18:53:34 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> + + * parse.y (string1, xstring, regexp): moved lex_strnest + initialization to string_contents/xstring_contents. + Tue Jun 25 19:24:38 2002 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp> * dln.c: remove definition rb_loaderror(). @@ -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 && |