Permalink
Browse files

Nudge towards calls knowing whether they should rewrite parens or not

  • Loading branch information...
1 parent 75f98a5 commit bef6d60d1dd5d0a1b86c44e664ac9626c28d546d @enebo enebo committed Apr 17, 2012
@@ -40,6 +40,7 @@
protected Node receiver;
private String name;
private Node arg;
+ private boolean hasParens;
public AttrAssignNode(SourcePosition position, Node receiver, String name, Node arg) {
super(position);
@@ -125,6 +126,14 @@ public void setArgs(Node argsNode) {
this.arg = argsNode;
}
+ public boolean hasParens() {
+ return hasParens;
+ }
+
+ public void setHasParens(boolean hasParens) {
+ this.hasParens = hasParens;
+ }
+
public List<Node> childNodes() {
return Node.createList(receiver, arg);
@@ -41,6 +41,7 @@
private Node argsNode;
protected Node iterNode;
protected String name;
+ private boolean hasParens = false;
public CallNode(SourcePosition position, Node receiverNode, String name, Node argsNode) {
this(position, receiverNode, name, argsNode, null);
@@ -113,6 +114,14 @@ public void setArgs(Node argsNode) {
this.argsNode = argsNode;
}
+ public boolean hasParens() {
+ return hasParens;
+ }
+
+ public void setHasParens(boolean hasParens) {
+ this.hasParens = hasParens;
+ }
+
/**
* Gets the name.
* name is the name of the method called
@@ -39,6 +39,7 @@
private Node argsNode;
protected Node iterNode;
protected String name;
+ private boolean hasParens = false;
public FCallNode(SourcePosition position, String name, Node argsNode) {
this(position, name, argsNode, null);
@@ -53,7 +54,7 @@ public FCallNode(SourcePosition position, String name, Node argsNode, Node iterN
this.iterNode = iterNode;
this.name = name;
}
-
+
public NodeType getNodeType() {
return NodeType.FCALLNODE;
}
@@ -65,6 +66,14 @@ public NodeType getNodeType() {
public Object accept(NodeVisitor iVisitor) {
return iVisitor.visitFCallNode(this);
}
+
+ public boolean hasParens() {
+ return hasParens;
+ }
+
+ public void setHasParens(boolean hasParens) {
+ this.hasParens = hasParens;
+ }
/**
* Get the node that represents a block or a block variable.
@@ -34,4 +34,6 @@
public interface IArgumentNode {
public Node getArgs();
public void setArgs(Node argsNode);
+ public boolean hasParens();
+ public void setHasParens(boolean hasParens);
}

0 comments on commit bef6d60

Please sign in to comment.