summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-24 15:18:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-24 15:18:00 +0000
commite8e3f56b8174efde3262040d6095b535da0e3512 (patch)
treef45b9462ec6fabd0f33014e0ae842bafc40e52ec /parse.y
parent05b4ec8683884ac9bd6ccde53e351ffe6562dc3d (diff)
* parse.y (string_dvar): allow back references in interpolation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 7 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index 60c54a1500..e21eae0c22 100644
--- a/parse.y
+++ b/parse.y
@@ -235,11 +235,11 @@ static void top_local_setup();
%type <node> command_args aref_args opt_block_arg block_arg var_ref var_lhs
%type <node> mrhs mrhs_basic superclass block_call block_command
%type <node> f_arglist f_args f_optarg f_opt f_block_arg opt_f_block_arg
-%type <node> assoc_list assocs assoc undef_list backref
+%type <node> assoc_list assocs assoc undef_list backref string_dvar
%type <node> block_var opt_block_var brace_block do_block lhs none
%type <node> mlhs mlhs_head mlhs_basic mlhs_entry mlhs_item mlhs_node
%type <id> fitem variable sym symbol operation operation2 operation3
-%type <id> cname fname op f_rest_arg string_dvar
+%type <id> cname fname op f_rest_arg
%type <num> f_norm_arg f_arg term_push
%token tUPLUS /* unary+ */
%token tUMINUS /* unary- */
@@ -1883,7 +1883,7 @@ string_content : tSTRING_CONTENT {$$ = NEW_STR($1);}
{
lex_strnest = $<num>1;
lex_strterm = $<node>2;
- $$ = gettable($3);
+ $$ = $3;
}
| tSTRING_DBEG term_push
{
@@ -1904,9 +1904,10 @@ string_content : tSTRING_CONTENT {$$ = NEW_STR($1);}
}
;
-string_dvar : tGVAR
- | tIVAR
- | tCVAR
+string_dvar : tGVAR {$$ = NEW_GVAR($1);}
+ | tIVAR {$$ = NEW_IVAR($1);}
+ | tCVAR {$$ = NEW_CVAR($1);}
+ | backref
;
term_push : /* */