Skip to content

Commit

Permalink
Showing 4 changed files with 3,854 additions and 3,902 deletions.
6 changes: 5 additions & 1 deletion core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java
Original file line number Diff line number Diff line change
@@ -748,6 +748,10 @@ private boolean isLabelSuffix() {
return peek(':') && !peek(':', 1);
}

private boolean isAfterOperator() {
return lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT;
}

private void determineExpressionState() {
switch (lex_state) {
case EXPR_FNAME: case EXPR_DOT:
@@ -2190,7 +2194,7 @@ private int pipe() throws IOException {

private int plus(boolean spaceSeen) throws IOException {
int c = nextc();
if (lex_state == LexState.EXPR_FNAME || lex_state == LexState.EXPR_DOT) {
if (isAfterOperator()) {
setState(LexState.EXPR_ARG);
if (c == '@') {
yaccValue = "+@";
1,472 changes: 744 additions & 728 deletions core/src/main/java/org/jruby/parser/RubyParser.java

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions core/src/main/java/org/jruby/parser/RubyParser.y
Original file line number Diff line number Diff line change
@@ -1173,8 +1173,12 @@ arg : lhs '=' arg {
| kDEFINED opt_nl arg {
$$ = support.new_defined($1, $3);
}
| arg '?' arg opt_nl ':' arg {
$$ = new IfNode(support.getPosition($1), support.getConditionNode($1), $3, $6);
| arg '?' {
lexer.getConditionState().begin();
} arg opt_nl ':' {
lexer.getConditionState().end();
} arg {
$$ = new IfNode(support.getPosition($1), support.getConditionNode($1), $4, $8);
}
| primary {
$$ = $1;
6,270 changes: 3,099 additions & 3,171 deletions core/src/main/java/org/jruby/parser/YyTables.java

Large diffs are not rendered by default.

0 comments on commit 5f93f4c

Please sign in to comment.