aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-12 15:42:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-12 15:42:53 +0900
commit7c22898a3a5a10c8c71683918b53ec2d17fdc621 (patch)
treeb6c105a9aa0c021fc79944734156472537c53fd1 /parse.y
parentdbaf589fb84a5b42111c85f993430133d8cae32f (diff)
downloadruby-7c22898a3a5a10c8c71683918b53ec2d17fdc621.tar.gz
Disable tOROP at EXPR_BEG
Both cannot appear there anyway.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 5 insertions, 9 deletions
diff --git a/parse.y b/parse.y
index dd55279118..0bda2d2db0 100644
--- a/parse.y
+++ b/parse.y
@@ -3453,15 +3453,6 @@ block_param_def : '|' opt_bv_decl '|'
/*% %*/
/*% 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)
return tOP_ASGN;
}
pushback(p, c);
+ if (IS_lex_state_for(last_state, EXPR_BEG)) {
+ c = '|';
+ pushback(p, '|');
+ return c;
+ }
return tOROP;
}
if (c == '=') {