ruby-changes:58738
From: Nobuyoshi <ko1@a...>
Date: Tue, 12 Nov 2019 15:46:36 +0900 (JST)
Subject: [ruby-changes:58738] 7c22898a3a (master): Disable tOROP at EXPR_BEG
https://git.ruby-lang.org/ruby.git/commit/?id=7c22898a3a From 7c22898a3a5a10c8c71683918b53ec2d17fdc621 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 12 Nov 2019 15:42:53 +0900 Subject: Disable tOROP at EXPR_BEG Both cannot appear there anyway. diff --git a/parse.y b/parse.y index dd55279..0bda2d2 100644 --- a/parse.y +++ b/parse.y @@ -3453,15 +3453,6 @@ block_param_def : '|' opt_bv_decl '|' https://github.com/ruby/ruby/blob/trunk/parse.y#L3453 /*% %*/ /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), escape_Qundef($2)) %*/ } - | tOROP - { - p->cur_arg = 0; - p->max_numparam = ORDINAL_PARAM; - /*%%%*/ - $$ = 0; - /*% %*/ - /*% ripper: block_var!(params!(Qnil,Qnil,Qnil,Qnil,Qnil,Qnil,Qnil), Qnil) %*/ - } | '|' block_param opt_bv_decl '|' { p->cur_arg = 0; @@ -9164,6 +9155,11 @@ parser_yylex(struct parser_params *p) https://github.com/ruby/ruby/blob/trunk/parse.y#L9155 return tOP_ASGN; } pushback(p, c); + if (IS_lex_state_for(last_state, EXPR_BEG)) { + c = '|'; + pushback(p, '|'); + return c; + } return tOROP; } if (c == '=') { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/