summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-05-04 21:33:58 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-05 14:46:39 +0900
commitb8f3be295b694964e88960c0228459b8aadd114a (patch)
tree4c4488f45e9ccfb2711e00d0289fb74ebffe42ee /parse.y
parent374c8f4ebab1a740990330c732b9de965c5e8d10 (diff)
Fix a case where numbered parameters should not be allowed
Because `proc{|| @1}` is a syntax error, the following should also be syntax errors: ```ruby proc { | | @1} ``` ```ruby proc { |; a| @1 } ``` This fixes both cases. [Bug #15825]
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index af425133c9..de64746159 100644
--- a/parse.y
+++ b/parse.y
@@ -3307,6 +3307,7 @@ opt_block_param : none
block_param_def : '|' opt_bv_decl '|'
{
p->cur_arg = 0;
+ p->max_numparam = -1;
/*%%%*/
$$ = 0;
/*% %*/