mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (string_content): preserve cond_stack and cmdarg_stack.
[ruby-core:29579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4d82ba512c
commit
cfab29b7db
3 changed files with 23 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Apr 18 12:32:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (string_content): preserve cond_stack and cmdarg_stack.
|
||||
[ruby-core:29579]
|
||||
|
||||
Sun Apr 18 05:50:58 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/lib/psych/visitors/yaml_tree.rb: defaulting binary string
|
||||
|
|
|
@ -884,3 +884,9 @@ assert_normal_exit %q{
|
|||
e
|
||||
}
|
||||
}, '[ruby-dev:39861]'
|
||||
|
||||
bug1240 = '[ruby-core:22637]'
|
||||
assert_valid_syntax('x y { "#{}".z { } }', bug1240)
|
||||
assert_valid_syntax('x y { "#{}".z do end }', bug1240)
|
||||
|
||||
assert_valid_syntax('y "#{a 1}" do end', '[ruby-core:29579]')
|
||||
|
|
20
parse.y
20
parse.y
|
@ -4029,6 +4029,12 @@ string_content : tSTRING_CONTENT
|
|||
%*/
|
||||
}
|
||||
| tSTRING_DBEG
|
||||
{
|
||||
$<num>1 = cond_stack;
|
||||
$<num>$ = cmdarg_stack;
|
||||
cond_stack = 0;
|
||||
cmdarg_stack = 0;
|
||||
}
|
||||
{
|
||||
$<node>$ = lex_strterm;
|
||||
lex_strterm = 0;
|
||||
|
@ -4036,12 +4042,14 @@ string_content : tSTRING_CONTENT
|
|||
}
|
||||
compstmt '}'
|
||||
{
|
||||
lex_strterm = $<node>2;
|
||||
cond_stack = $<num>1;
|
||||
cmdarg_stack = $<num>2;
|
||||
lex_strterm = $<node>3;
|
||||
/*%%%*/
|
||||
if ($3) $3->flags &= ~NODE_FL_NEWLINE;
|
||||
$$ = new_evstr($3);
|
||||
if ($4) $4->flags &= ~NODE_FL_NEWLINE;
|
||||
$$ = new_evstr($4);
|
||||
/*%
|
||||
$$ = dispatch1(string_embexpr, $3);
|
||||
$$ = dispatch1(string_embexpr, $4);
|
||||
%*/
|
||||
}
|
||||
;
|
||||
|
@ -5869,8 +5877,6 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
|
|||
pushback(c);
|
||||
return tSTRING_DVAR;
|
||||
case '{':
|
||||
COND_PUSH(0);
|
||||
CMDARG_PUSH(0);
|
||||
return tSTRING_DBEG;
|
||||
}
|
||||
tokadd('#');
|
||||
|
@ -6068,8 +6074,6 @@ parser_here_document(struct parser_params *parser, NODE *here)
|
|||
pushback(c);
|
||||
return tSTRING_DVAR;
|
||||
case '{':
|
||||
COND_PUSH(0);
|
||||
CMDARG_PUSH(0);
|
||||
return tSTRING_DBEG;
|
||||
}
|
||||
tokadd('#');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue