*** parse.y.1.9.3-p0 2011-11-05 12:38:44.000000000 +0900 --- parse.y 2011-11-05 11:57:59.000000000 +0900 *************** top_stmt : stmt *** 877,911 **** } ; ! bodystmt : compstmt opt_rescue opt_else opt_ensure { /*%%%*/ ! $$ = $1; ! if ($2) { ! $$ = NEW_RESCUE($1, $2, $3); } ! else if ($3) { rb_warn0("else without rescue is useless"); ! $$ = block_append($$, $3); } ! if ($4) { if ($$) { ! $$ = NEW_ENSURE($$, $4); } else { ! $$ = block_append($4, NEW_NIL()); } } ! fixpos($$, $1); /*% $$ = dispatch4(bodystmt, - escape_Qundef($1), escape_Qundef($2), escape_Qundef($3), ! escape_Qundef($4)); %*/ } ; --- 877,912 ---- } ; ! bodystmt : opt_type ! compstmt opt_rescue opt_else opt_ensure { /*%%%*/ ! $$ = $2; ! if ($3) { ! $$ = NEW_RESCUE($2, $3, $4); } ! else if ($4) { rb_warn0("else without rescue is useless"); ! $$ = block_append($$, $4); } ! if ($5) { if ($$) { ! $$ = NEW_ENSURE($$, $5); } else { ! $$ = block_append($5, NEW_NIL()); } } ! fixpos($$, $2); /*% $$ = dispatch4(bodystmt, escape_Qundef($2), escape_Qundef($3), ! escape_Qundef($4), ! escape_Qundef($5)); %*/ } ; *************** stmt : keyword_alias fitem {lex_state = *** 989,994 **** --- 990,1004 ---- $$ = dispatch1(alias_error, $$); %*/ } + | lhs ':' cpath '=' arg + { + /*%%%*/ + value_expr($5); + $$ = node_assign($1, $5); + /*% + $$ = dispatch2(assign, $1, $5); + %*/ + } | keyword_undef undef_list { /*%%%*/ *************** cases : opt_else *** 3768,3773 **** --- 3778,3787 ---- | case_body ; + opt_type : ':' cpath + | none + ; + opt_rescue : keyword_rescue exc_list exc_var then compstmt opt_rescue *************** f_norm_arg : f_bad_arg *** 4546,4551 **** --- 4560,4566 ---- ; f_arg_item : f_norm_arg + opt_type { arg_var(get_id($1)); /*%%%*/