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

Commits on May 5, 2015

  1. Copy the full SHA
    e8f1cfc View commit details
  2. Copy the full SHA
    428e058 View commit details
11 changes: 1 addition & 10 deletions core/src/main/java/org/jruby/ast/AssignableNode.java
Original file line number Diff line number Diff line change
@@ -30,14 +30,12 @@
***** END LICENSE BLOCK *****/
package org.jruby.ast;

import org.jruby.ast.types.IArityNode;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.runtime.Arity;

/**
* Base class of any node which can be assigned to.
*/
public abstract class AssignableNode extends Node implements IArityNode {
public abstract class AssignableNode extends Node {
private Node valueNode;

public AssignableNode(ISourcePosition position) {
@@ -67,11 +65,4 @@ public Node getValueNode() {
public void setValueNode(Node valueNode) {
this.valueNode = valueNode == null ? NilImplicitNode.NIL : valueNode;
}

/**
* Almost all assignables are only assigned a single value.
*/
public Arity getArity() {
return Arity.singleArgument();
}
}
11 changes: 1 addition & 10 deletions core/src/main/java/org/jruby/ast/InstVarNode.java
Original file line number Diff line number Diff line change
@@ -34,16 +34,14 @@

import java.util.List;

import org.jruby.ast.types.IArityNode;
import org.jruby.ast.types.INameNode;
import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.runtime.Arity;

/**
* Represents an instance variable accessor.
*/
public class InstVarNode extends Node implements IArityNode, INameNode {
public class InstVarNode extends Node implements INameNode {
private String name;

public InstVarNode(ISourcePosition position, String name) {
@@ -62,13 +60,6 @@ public NodeType getNodeType() {
public <T> T accept(NodeVisitor<T> iVisitor) {
return iVisitor.visitInstVarNode(this);
}

/**
* A variable accessor takes no arguments.
*/
public Arity getArity() {
return Arity.noArguments();
}

/**
* Gets the name.
13 changes: 0 additions & 13 deletions core/src/main/java/org/jruby/ast/MultipleAsgn19Node.java
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@

import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.runtime.Arity;

/**
*
@@ -40,19 +39,12 @@ public class MultipleAsgn19Node extends AssignableNode {
private final ListNode pre;
private final Node rest;
private final ListNode post;
private final Arity arity;

public MultipleAsgn19Node(ISourcePosition position, ListNode pre, Node rest, ListNode post) {
super(position);
this.pre = pre;
this.rest = rest;
this.post = post;

if (getRest() != null) {
arity = Arity.required(getPreCount() + getPostCount());
} else {
arity = Arity.fixed(getPreCount() + getPostCount());
}
}

public NodeType getNodeType() {
@@ -83,11 +75,6 @@ public ListNode getPost() {
return post;
}

@Override
public Arity getArity() {
return arity;
}

public List<Node> childNodes() {
return Node.createList(pre, rest, getValueNode());
}
17 changes: 0 additions & 17 deletions core/src/main/java/org/jruby/ast/MultipleAsgnNode.java
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@

import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.runtime.Arity;

public class MultipleAsgnNode extends AssignableNode {
private final ListNode pre;
@@ -70,10 +69,6 @@ public ListNode getHeadNode() {
public ListNode getPre() {
return pre;
}

public int getPreCount() {
return pre == null ? 0 : pre.size();
}

/**
* Gets the argsNode.
@@ -87,18 +82,6 @@ public Node getRest() {
return rest;
}

/**
* Number of arguments is dependent on headNodes size
*/
@Override
public Arity getArity() {
if (rest != null) {
return Arity.required(pre == null ? 0 : pre.size());
}

return Arity.fixed(pre.size());
}

public List<Node> childNodes() {
return Node.createList(pre, rest, getValueNode());
}
11 changes: 1 addition & 10 deletions core/src/main/java/org/jruby/ast/ZSuperNode.java
Original file line number Diff line number Diff line change
@@ -32,15 +32,13 @@
package org.jruby.ast;

import java.util.List;
import org.jruby.ast.types.IArityNode;
import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.runtime.Arity;

/**
* a call to 'super' with no arguments in a method.
*/
public class ZSuperNode extends Node implements IArityNode, BlockAcceptingNode {
public class ZSuperNode extends Node implements BlockAcceptingNode {
private Node iterNode;

public ZSuperNode(ISourcePosition position) {
@@ -58,13 +56,6 @@ public NodeType getNodeType() {
public <T> T accept(NodeVisitor<T> iVisitor) {
return iVisitor.visitZSuperNode(this);
}

/**
* 'super' can take any number of arguments.
*/
public Arity getArity() {
return Arity.optional();
}

public List<Node> childNodes() {
return iterNode != null ? createList(iterNode) : EMPTY_LIST;
39 changes: 0 additions & 39 deletions core/src/main/java/org/jruby/ast/types/IArityNode.java

This file was deleted.