From 95970e950b6cb5ff093ef088f885236a708e92f4 Mon Sep 17 00:00:00 2001 From: Watson Date: Sat, 14 Jan 2012 20:08:32 +0900 Subject: [PATCH] also in ripper, saves in_def before restoring --- parse.y | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/parse.y b/parse.y index b0145047d..4cd828901 100644 --- a/parse.y +++ b/parse.y @@ -2953,22 +2953,16 @@ primary : literal } | keyword_class tLSHFT expr { - /*%%%*/ $$ = in_def; in_def = 0; - /*% - in_def = 0; - %*/ } term { - /*%%%*/ $$ = in_single; in_single = 0; + /*%%%*/ local_push(0); /*% - $$ = in_single; - in_single = 0; %*/ } bodystmt @@ -2978,13 +2972,11 @@ primary : literal $$ = NEW_SCLASS($3, $7); fixpos($$, $3); local_pop(); - in_def = $4; - in_single = $6; /*% $$ = dispatch2(sclass, $3, $7); - in_def = $4; - in_single = $6; %*/ + in_def = $4; + in_single = $6; } | keyword_module cpath { @@ -3045,13 +3037,11 @@ primary : literal in_def_named_args = 0; #endif local_pop(); - in_def--; - cur_mid = $3; /*% $$ = dispatch3(def, $2, $4, $5); + %*/ in_def--; cur_mid = $3; - %*/ } | keyword_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname { @@ -3090,11 +3080,10 @@ primary : literal in_def_named_args = 0; #endif local_pop(); - in_single--; /*% $$ = dispatch5(defs, $2, $3, $5, $7, $8); - in_single--; %*/ + in_single--; } | keyword_break {