diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-25 09:56:36 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-25 09:56:36 +0000 |
| commit | 161e8358bd3e071441c2d73c87b56fa3e4284bb9 (patch) | |
| tree | 694fe1bd97e0220f82d94b292232944b4ec7f6b4 | |
| parent | 7aa92b7a69fb9289ef765d29dbb2f8fe8ff51e21 (diff) | |
| download | ruby-161e8358bd3e071441c2d73c87b56fa3e4284bb9.tar.gz ruby-161e8358bd3e071441c2d73c87b56fa3e4284bb9.tar.xz ruby-161e8358bd3e071441c2d73c87b56fa3e4284bb9.zip | |
* parse.y (string1, xstring, regexp): moved lex_strnest
initialization to string_contents/xstring_contents.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -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 && |
