Skip to content

Commit

Permalink
Gvar returning random identifier instead of the gvar
Browse files Browse the repository at this point in the history
enebo committed May 23, 2017
1 parent ebc4675 commit 64a132d
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java
Original file line number Diff line number Diff line change
@@ -1385,7 +1385,8 @@ private int dollar() throws IOException {
pushback('-');
return '$';
}
yaccValue = createTokenString().intern();
createTokenString().intern();
yaccValue = getIdentifier();
/* xxx shouldn't check if valid option variable */
return Tokens.tGVAR;

2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/parser/RubyParser.java
Original file line number Diff line number Diff line change
@@ -4801,7 +4801,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException {
};
states[501] = new ParserState() {
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) {
yyVal = lexer.getIdentifier();
yyVal = ((ByteList)yyVals[0+yyTop]);
return yyVal;
}
};
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/parser/RubyParser.y
Original file line number Diff line number Diff line change
@@ -2181,7 +2181,7 @@ sym : fname
$$ = lexer.getIdentifier();
}
| tGVAR {
$$ = lexer.getIdentifier();
$$ = $1;
}
| tCVAR {
$$ = lexer.getIdentifier();

0 comments on commit 64a132d

Please sign in to comment.