From e62dcaf45c096d55e5c9eb52edf7125af0cd3939 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 4 Oct 2003 17:51:11 +0000 Subject: * marshal.c (w_object): instance variable dump do not cause error for objects that cannot be dumped, if they traversed from marshal_dump. they are just ignored. * gc.c (Init_stack): cast "space" (doble value) into unsigned int. should run on PowerPC. * eval.c (rb_eval): should not execute else part if any exception is caught. [ruby-dev:21482] * parse.y (f_args): should allow unparenthesized block argument. * parse.y (f_rest_arg): should allow unparenthesized rest argument. * lib/irb/ruby-lex.rb (RubyLex::identify_identifier): support 'class ::Foo' syntax. [ruby-talk:83514] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 7b3d2e6a7..7f70de048 100644 --- a/parse.y +++ b/parse.y @@ -2267,7 +2267,11 @@ f_optarg : f_opt } ; -f_rest_arg : tSTAR tIDENTIFIER +restarg_mark : '*' + | tSTAR + ; + +f_rest_arg : restarg_mark tIDENTIFIER { if (!is_local_id($2)) yyerror("rest argument must be local variable"); @@ -2275,13 +2279,17 @@ f_rest_arg : tSTAR tIDENTIFIER yyerror("duplicate rest argument name"); $$ = local_cnt($2); } - | tSTAR + | restarg_mark { $$ = -2; } ; -f_block_arg : tAMPER tIDENTIFIER +blkarg_mark : '&' + | tAMPER + ; + +f_block_arg : blkarg_mark tIDENTIFIER { if (!is_local_id($2)) yyerror("block argument must be local variable"); -- cgit