Skip to content

Commit 5dc99c3

Browse files
committedDec 6, 2017
Fixes another regression from fix of #4882. In this case we would look for
duplicated variables in higher level production f_opt and f_block_opt but now that check is done at the actual variable itself.
1 parent 2eafcdb commit 5dc99c3

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
 

‎core/src/main/java/org/jruby/ext/ripper/RipperParser.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -4608,7 +4608,6 @@ public Object yyparse (RipperLexer yyLex) throws java.io.IOException {
46084608
states[591] = new RipperParserState() {
46094609
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) {
46104610
p.setCurrentArg(null);
4611-
p.arg_var(p.formal_argument(((IRubyObject)yyVals[-2+yyTop])));
46124611
yyVal = p.new_assoc(p.assignable(((IRubyObject)yyVals[-2+yyTop])), ((IRubyObject)yyVals[0+yyTop]));
46134612

46144613
return yyVal;
@@ -4617,7 +4616,6 @@ public Object yyparse (RipperLexer yyLex) throws java.io.IOException {
46174616
states[592] = new RipperParserState() {
46184617
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) {
46194618
p.setCurrentArg(null);
4620-
p.arg_var(p.formal_argument(((IRubyObject)yyVals[-2+yyTop])));
46214619
yyVal = p.new_assoc(p.assignable(((IRubyObject)yyVals[-2+yyTop])), ((IRubyObject)yyVals[0+yyTop]));
46224620
return yyVal;
46234621
}
@@ -4799,6 +4797,6 @@ public Object yyparse (RipperLexer yyLex) throws java.io.IOException {
47994797
}
48004798
};
48014799
}
4802-
// line 2155 "RipperParser.y"
4800+
// line 2153 "RipperParser.y"
48034801
}
4804-
// line 9486 "-"
4802+
// line 9484 "-"

‎core/src/main/java/org/jruby/ext/ripper/RipperParser.y

-2
Original file line numberDiff line numberDiff line change
@@ -2012,14 +2012,12 @@ f_kwrest : kwrest_mark tIDENTIFIER {
20122012

20132013
f_opt : f_arg_asgn '=' arg_value {
20142014
p.setCurrentArg(null);
2015-
p.arg_var(p.formal_argument($1));
20162015
$$ = p.new_assoc(p.assignable($1), $3);
20172016

20182017
}
20192018

20202019
f_block_opt : f_arg_asgn '=' primary_value {
20212020
p.setCurrentArg(null);
2022-
p.arg_var(p.formal_argument($1));
20232021
$$ = p.new_assoc(p.assignable($1), $3);
20242022
}
20252023

0 commit comments

Comments
 (0)
Please sign in to comment.