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: 9425fbd35c7d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7d264afe8260
Choose a head ref
  • 6 commits
  • 11 files changed
  • 1 contributor

Commits on May 5, 2015

  1. Copy the full SHA
    2419f73 View commit details
  2. Copy the full SHA
    6ac15ee View commit details
  3. Copy the full SHA
    1cf12e4 View commit details
  4. We only use one yield type now

    enebo committed May 5, 2015
    Copy the full SHA
    4e61175 View commit details
  5. Copy the full SHA
    7bee67c View commit details
  6. Copy the full SHA
    7d264af View commit details
4 changes: 0 additions & 4 deletions core/src/main/java/org/jruby/ast/NthRefNode.java
Original file line number Diff line number Diff line change
@@ -43,13 +43,9 @@
public class NthRefNode extends Node {
private final int matchNumber;

/** ByteList representing the name of this numbered nth ref */
private final DefinedMessage definedMessage;

public NthRefNode(ISourcePosition position, int matchNumber) {
super(position, false);
this.matchNumber = matchNumber;
this.definedMessage = DefinedMessage.byText("$" + matchNumber);
}

public NodeType getNodeType() {
51 changes: 0 additions & 51 deletions core/src/main/java/org/jruby/ast/OpElementOneArgAndAsgnNode.java

This file was deleted.

51 changes: 0 additions & 51 deletions core/src/main/java/org/jruby/ast/OpElementOneArgAsgnNode.java

This file was deleted.

51 changes: 0 additions & 51 deletions core/src/main/java/org/jruby/ast/OpElementOneArgOrAsgnNode.java

This file was deleted.

16 changes: 0 additions & 16 deletions core/src/main/java/org/jruby/ast/SymbolNode.java
Original file line number Diff line number Diff line change
@@ -54,16 +54,8 @@
*/
public class SymbolNode extends Node implements ILiteralNode, INameNode {
private String name;
private RubySymbol symbol;
private Encoding encoding;

public SymbolNode(ISourcePosition position, String name) {
super(position, false);

this.name = name;
this.encoding = null;
}

public SymbolNode(ISourcePosition position, ByteList value) {
super(position, false);
this.name = value.toString().intern();
@@ -98,12 +90,4 @@ public Encoding getEncoding() {
public List<Node> childNodes() {
return EMPTY_LIST;
}

public RubySymbol getSymbol(Ruby runtime) {
RubySymbol sym;
if ((sym = symbol) != null) return sym;
sym = runtime.fastNewSymbol(name);
if (encoding != null) sym.associateEncoding(encoding);
return symbol = sym;
}
}
17 changes: 0 additions & 17 deletions core/src/main/java/org/jruby/ast/Yield19Node.java

This file was deleted.

16 changes: 2 additions & 14 deletions core/src/main/java/org/jruby/ast/YieldNode.java
Original file line number Diff line number Diff line change
@@ -40,25 +40,17 @@
*/
public class YieldNode extends Node {
private final Node argsNode;
private final boolean expandedArguments;

/**
* Construct a new YieldNode.
*
* @param position position of the node in the source
* @param argsNode the arguments to the yield
* @param expandedArguments whether the arguments should be treated as directly-passed args
* as in yield 1, 2, 3 (expandedArguments = true) versus
* yield [1, 2, 3] (expandedArguments = false).
* @param argsNode the arguments to the yield (null == no args)
*/
public YieldNode(ISourcePosition position, Node argsNode, boolean expandedArguments) {
public YieldNode(ISourcePosition position, Node argsNode) {
super(position, argsNode != null && argsNode.containsVariableAssignment());

// block.yield depends on null to represent empty and nil to represent nil - [nil] vs []
//assert argsNode != null : "argsNode is not null";

this.argsNode = argsNode;
this.expandedArguments = expandedArguments;
}

public NodeType getNodeType() {
@@ -81,10 +73,6 @@ public Node getArgsNode() {
return argsNode;
}

public boolean getExpandArguments() {
return expandedArguments;
}

@Override
public List<Node> childNodes() {
return createList(argsNode);
18 changes: 0 additions & 18 deletions core/src/main/java/org/jruby/ast/ZYieldNode.java

This file was deleted.

22 changes: 2 additions & 20 deletions core/src/main/java/org/jruby/parser/ParserSupport.java
Original file line number Diff line number Diff line change
@@ -750,26 +750,8 @@ public WhenNode newWhenNode(ISourcePosition position, Node expressionNodes, Node
// FIXME: Currently this is passing in position of receiver
public Node new_opElementAsgnNode(Node receiverNode, String operatorName, Node argsNode, Node valueNode) {
ISourcePosition position = lexer.tokline; // FIXME: ruby_sourceline in new lexer.
Node newNode = null;

if (argsNode instanceof ArrayNode) {
ArrayNode array = (ArrayNode) argsNode;

if (array.size() == 1) {
if (operatorName.equals("||")) {
newNode = new OpElementOneArgOrAsgnNode(position, receiverNode, operatorName, array, valueNode);
} else if (operatorName.equals("&&")) {

newNode = new OpElementOneArgAndAsgnNode(position, receiverNode, operatorName, array, valueNode);
} else {
newNode = new OpElementOneArgAsgnNode(position, receiverNode, operatorName, array, valueNode);
}
}
}

if (newNode == null) {
newNode = new OpElementAsgnNode(position, receiverNode, operatorName, argsNode, valueNode);
}
Node newNode = new OpElementAsgnNode(position, receiverNode, operatorName, argsNode, valueNode);

fixpos(newNode, receiverNode);

@@ -1003,7 +985,7 @@ public Node new_yield(ISourcePosition position, Node node) {
lexer.getCurrentLine(), "Block argument should not be given.");
}

return new Yield19Node(position, node);
return new YieldNode(position, node);
}

public NumericNode negateInteger(NumericNode integerNode) {
12 changes: 6 additions & 6 deletions core/src/main/java/org/jruby/parser/RubyParser.java
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
import org.jruby.ast.BlockNode;
import org.jruby.ast.BlockPassNode;
import org.jruby.ast.BreakNode;
import org.jruby.ast.CallNode;
import org.jruby.ast.ClassNode;
import org.jruby.ast.ClassVarNode;
import org.jruby.ast.ClassVarAsgnNode;
@@ -112,7 +113,6 @@
import org.jruby.ast.YieldNode;
import org.jruby.ast.ZArrayNode;
import org.jruby.ast.ZSuperNode;
import org.jruby.ast.ZYieldNode;
import org.jruby.ast.types.ILiteralNode;
import org.jruby.common.IRubyWarnings;
import org.jruby.common.IRubyWarnings.ID;
@@ -147,7 +147,7 @@ public void setWarnings(IRubyWarnings warnings) {
support.setWarnings(warnings);
lexer.setWarnings(warnings);
}
// line 152 "-"
// line 151 "-"
// %token constants
public static final int kCLASS = 257;
public static final int kMODULE = 258;
@@ -3431,13 +3431,13 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException {
};
states[317] = new ParserState() {
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) {
yyVal = new ZYieldNode(((ISourcePosition)yyVals[-2+yyTop]));
yyVal = new YieldNode(((ISourcePosition)yyVals[-2+yyTop]), null);
return yyVal;
}
};
states[318] = new ParserState() {
@Override public Object execute(ParserSupport support, RubyLexer lexer, Object yyVal, Object[] yyVals, int yyTop) {
yyVal = new ZYieldNode(((ISourcePosition)yyVals[0+yyTop]));
yyVal = new YieldNode(((ISourcePosition)yyVals[0+yyTop]), null);
return yyVal;
}
};
@@ -5244,7 +5244,7 @@ public Object yyparse (RubyLexer yyLex) throws java.io.IOException {
}
};
}
// line 2514 "RubyParser.y"
// line 2513 "RubyParser.y"

/** The parse method use an lexer stream and parse it to an AST node
* structure
@@ -5259,4 +5259,4 @@ public RubyParserResult parse(ParserConfiguration configuration) throws IOExcept
return support.getResult();
}
}
// line 9789 "-"
// line 9788 "-"
Loading