Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1befb7b0dbba
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4d98439ef5b3
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 27, 2015

  1. Copy the full SHA
    6d9344c View commit details
  2. Copy the full SHA
    4d98439 View commit details
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/ir/IRScope.java
Original file line number Diff line number Diff line change
@@ -1026,6 +1026,7 @@ public Operand[] getCallArgs() {

// We have two paths. eval and non-eval.
if (instrList == null) { // CFG already made. eval has zsuper and we walk back to some executing method/script
// FIXME: Need to verify this can never re-order recvs in a way to swap order to zsuper
for (BasicBlock bb: getCFG().getBasicBlocks()) {
for (Instr instr: bb.getInstrs()) {
extractCallOperands(callArgs, keywordArgs, instr);
15 changes: 12 additions & 3 deletions core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java
Original file line number Diff line number Diff line change
@@ -260,7 +260,7 @@ public enum Keyword {

public enum LexState {
EXPR_BEG, EXPR_END, EXPR_ARG, EXPR_CMDARG, EXPR_ENDARG, EXPR_MID,
EXPR_FNAME, EXPR_DOT, EXPR_CLASS, EXPR_VALUE, EXPR_ENDFN
EXPR_FNAME, EXPR_DOT, EXPR_CLASS, EXPR_VALUE, EXPR_ENDFN, EXPR_LABELARG
}

public static Keyword getKeyword(String str) {
@@ -329,6 +329,7 @@ public void newtok() {
private int braceNest = 0;

private int leftParenBegin = 0;
public boolean inKwarg = false;

public int incrementParenNest() {
parenNest++;
@@ -510,7 +511,8 @@ private boolean isNext_identchar() throws IOException {

private boolean isBEG() {
return lex_state == LexState.EXPR_BEG || lex_state == LexState.EXPR_MID ||
lex_state == LexState.EXPR_CLASS || (lex_state == LexState.EXPR_VALUE);
lex_state == LexState.EXPR_CLASS || lex_state == LexState.EXPR_VALUE ||
lex_state == LexState.EXPR_LABELARG;
}

private boolean isEND() {
@@ -1160,6 +1162,13 @@ private int yylex() throws IOException {
case EXPR_BEG: case EXPR_FNAME: case EXPR_DOT:
case EXPR_CLASS: case EXPR_VALUE:
continue loop;
case EXPR_LABELARG:
if (inKwarg) {
commandStart = true;
setState(LexState.EXPR_BEG);
return '\n';
}
continue loop;
}

boolean done = false;
@@ -1816,7 +1825,7 @@ private int identifier(int c, boolean commandState) throws IOException {
if (isLabelPossible(commandState)) {
int c2 = src.read();
if (c2 == ':' && !src.peek(':')) {
setState(LexState.EXPR_BEG);
setState(LexState.EXPR_LABELARG);
yaccValue = tempVal;
return Tokens.tLABEL;
}
755 changes: 382 additions & 373 deletions core/src/main/java/org/jruby/parser/RubyParser.java

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions core/src/main/java/org/jruby/parser/RubyParser.y
Original file line number Diff line number Diff line change
@@ -225,7 +225,8 @@ public class RubyParser {
%type <Node> call_args opt_ensure paren_args superclass
%type <Node> command_args var_ref opt_paren_args block_call block_command
%type <Node> f_opt undef_list string_dvar backref
%type <ArgsNode> f_args f_arglist f_larglist block_param block_param_def opt_block_param
%type <ArgsNode> f_args f_larglist block_param block_param_def opt_block_param
%type <Object> f_arglist
%type <Node> mrhs mlhs_item mlhs_node arg_value case_body exc_list aref_args
// ENEBO: missing block_var == for_var, opt_block_var
%type <Node> lhs none args
@@ -1479,7 +1480,7 @@ primary : literal
Node body = $5;
if (body == null) body = NilImplicitNode.NIL;

$$ = new DefnNode($1, new ArgumentNode($1, $2), $4, support.getCurrentScope(), body);
$$ = new DefnNode($1, new ArgumentNode($1, $2), (ArgsNode) $4, support.getCurrentScope(), body);
support.popCurrentScope();
support.setInDef(false);
}
@@ -1493,7 +1494,7 @@ primary : literal
Node body = $8;
if (body == null) body = NilImplicitNode.NIL;

$$ = new DefsNode($1, $2, new ArgumentNode($1, $5), $7, support.getCurrentScope(), body);
$$ = new DefsNode($1, $2, new ArgumentNode($1, $5), (ArgsNode) $7, support.getCurrentScope(), body);
support.popCurrentScope();
support.setInSingle(support.getInSingle() - 1);
}
@@ -2185,8 +2186,12 @@ f_arglist : tLPAREN2 f_args rparen {
lexer.setState(LexState.EXPR_BEG);
lexer.commandStart = true;
}
| f_args term {
$$ = $1;
| {
$$ = lexer.inKwarg;
lexer.inKwarg = true;
} f_args term {
lexer.inKwarg = $<Boolean>1;
$$ = $2;
lexer.setState(LexState.EXPR_BEG);
lexer.commandStart = true;
}
6,918 changes: 3,495 additions & 3,423 deletions core/src/main/java/org/jruby/parser/YyTables.java

Large diffs are not rendered by default.