summaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-26 13:33:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-26 13:33:14 +0000
commit5e7a785b405eb533f1a52f1bbf057bbbe89fa6ee (patch)
treee7a4ebf6d948a323be51af989ef19b3707dbc424 /parse.y
parentb72e4fe85236cf76a63f8664d32b87fe1a53b952 (diff)
downloadruby-5e7a785b405eb533f1a52f1bbf057bbbe89fa6ee.tar.gz
ruby-5e7a785b405eb533f1a52f1bbf057bbbe89fa6ee.tar.xz
ruby-5e7a785b405eb533f1a52f1bbf057bbbe89fa6ee.zip
* eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,
NEW_VALIAS), parse.y (fitem): allow dynamic symbols to NODE_UNDEF and NODE_ALIAS. backported from trunk. fixed: [ruby-dev:28105] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 10 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index 2fc0fcc61..0fc91b0d5 100644
--- a/parse.y
+++ b/parse.y
@@ -277,9 +277,9 @@ static void top_local_setup();
%type <node> mrhs 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 string_dvar
-%type <node> block_var opt_block_var brace_block cmd_brace_block do_block lhs none
+%type <node> block_var opt_block_var brace_block cmd_brace_block do_block lhs none fitem
%type <node> mlhs mlhs_head mlhs_basic mlhs_entry mlhs_item mlhs_node
-%type <id> fitem variable sym symbol operation operation2 operation3
+%type <id> fsym variable sym symbol operation operation2 operation3
%type <id> cname fname op f_rest_arg
%type <num> f_norm_arg f_arg
%token tUPLUS /* unary+ */
@@ -916,10 +916,17 @@ fname : tIDENTIFIER
}
;
-fitem : fname
+fsym : fname
| symbol
;
+fitem : fsym
+ {
+ $$ = NEW_LIT(ID2SYM($1));
+ }
+ | dsym
+ ;
+
undef_list : fitem
{
$$ = NEW_UNDEF($1);