* 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
This commit is contained in:
parent
fb0eb3ccd9
commit
a97ba8c7f7
@ -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>
|
Tue Jun 25 19:24:38 2002 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp>
|
||||||
|
|
||||||
* dln.c: remove definition rb_loaderror().
|
* dln.c: remove definition rb_loaderror().
|
||||||
|
22
parse.y
22
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) {
|
if (!node) {
|
||||||
node = NEW_XSTR(rb_str_new(0, 0));
|
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);
|
nd_set_type(node, NODE_DXSTR);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
node = rb_node_newnode(NODE_DXSTR,
|
node = rb_node_newnode(NODE_DXSTR, rb_str_new(0, 0),
|
||||||
rb_str_new(0, 0), 1, NEW_LIST(node));
|
1, NEW_LIST(node));
|
||||||
break;
|
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;
|
int options = $3;
|
||||||
NODE *node = $3;
|
NODE *node = $2;
|
||||||
if (!node) {
|
if (!node) {
|
||||||
node = NEW_LIT(rb_reg_new("", 0, options & ~RE_OPTION_ONCE));
|
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 */
|
string_contents : /* none */
|
||||||
{
|
{
|
||||||
|
lex_strnest = 0;
|
||||||
$$ = 0;
|
$$ = 0;
|
||||||
}
|
}
|
||||||
| string_contents string_content
|
| string_contents string_content
|
||||||
@ -1863,6 +1864,7 @@ string_contents : /* none */
|
|||||||
|
|
||||||
xstring_contents: /* none */
|
xstring_contents: /* none */
|
||||||
{
|
{
|
||||||
|
lex_strnest = 0;
|
||||||
$$ = 0;
|
$$ = 0;
|
||||||
}
|
}
|
||||||
| xstring_contents string_content
|
| xstring_contents string_content
|
||||||
@ -1910,7 +1912,7 @@ string_dvar : tGVAR {$$ = NEW_GVAR($1);}
|
|||||||
| backref
|
| backref
|
||||||
;
|
;
|
||||||
|
|
||||||
term_push : /* */
|
term_push : /* none */
|
||||||
{
|
{
|
||||||
if (($$ = quoted_term) == -1 &&
|
if (($$ = quoted_term) == -1 &&
|
||||||
nd_type(lex_strterm) == NODE_STRTERM &&
|
nd_type(lex_strterm) == NODE_STRTERM &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user