From 635d3150e3e85c01b777ff165e21fa8965d58440 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:08:11 -0400 Subject: Cleanup --- dice-lang/src/bjc/dicelang/Node.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'dice-lang/src/bjc/dicelang/Node.java') diff --git a/dice-lang/src/bjc/dicelang/Node.java b/dice-lang/src/bjc/dicelang/Node.java index 15ae66e..df966ba 100644 --- a/dice-lang/src/bjc/dicelang/Node.java +++ b/dice-lang/src/bjc/dicelang/Node.java @@ -12,10 +12,10 @@ public class Node { public final Type type; // These can have or not have values based of the node type - public Token tokenVal; - public Token.Type operatorType; - public GroupType groupType; - public EvaluatorResult resultVal; + public Token tokenVal; + public Token.Type operatorType; + public GroupType groupType; + public EvaluatorResult resultVal; public Node(Type typ) { type = typ; @@ -45,8 +45,9 @@ public class Node { resultVal = res; } + @Override public String toString() { - switch (type) { + switch(type) { case UNARYOP: case BINOP: return "(" + type.name() + " : " + operatorType + ")"; @@ -62,16 +63,15 @@ public class Node { } } + @Override public boolean equals(Object other) { - if (!(other instanceof Node)) - return false; + if(!(other instanceof Node)) return false; Node otk = (Node) other; - if (otk.type != type) - return false; + if(otk.type != type) return false; - switch (type) { + switch(type) { case OGROUP: return tokenVal.equals(otk.tokenVal); default: -- cgit v1.2.3