diff options
| author | EVE <EVE@EVE-PC> | 2017-03-14 12:08:11 -0400 |
|---|---|---|
| committer | EVE <EVE@EVE-PC> | 2017-03-14 12:08:11 -0400 |
| commit | 635d3150e3e85c01b777ff165e21fa8965d58440 (patch) | |
| tree | 3389128f83a5a79f8d0eec0a0e19f54b9d117b66 /dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java | |
| parent | e59e2a97773f93bdd25bd4680809c10699f0feb3 (diff) | |
Cleanup
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java b/dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java index 4d710fe..e37d3c3 100644 --- a/dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java +++ b/dice-lang/src/bjc/dicelang/v1/ast/DiceASTUtils.java @@ -11,14 +11,14 @@ import bjc.utils.data.ITree; /** * Functions that are useful when dealing with dice ASTs - * + * * @author ben * */ public class DiceASTUtils { /** * Check if a dice AST contains a simple variable reference - * + * * @param nameTree * The tree to check for a reference in * @return Whether or not a dice AST contains a simple variable @@ -26,9 +26,7 @@ public class DiceASTUtils { */ public static boolean containsSimpleVariable(ITree<IDiceASTNode> nameTree) { return nameTree.transformHead((nameNode) -> { - if (nameNode.getType() != DiceASTType.VARIABLE) { - return false; - } + if(nameNode.getType() != DiceASTType.VARIABLE) return false; return true; }); @@ -36,11 +34,11 @@ public class DiceASTUtils { /** * Convert an literal AST node to a dice expression, if possible. - * + * * @param tree * The node to convert in tree form * @return The tree as a dice expression - * + * * @throws ClassCastException * if the head of the tree is not a literal (implements * {@link ILiteralDiceNode}) @@ -50,7 +48,7 @@ public class DiceASTUtils { public static IDiceExpression literalToExpression(ITree<IDiceASTNode> tree) { ILiteralDiceNode literalNode = (ILiteralDiceNode) tree.getHead(); - switch (literalNode.getLiteralType()) { + switch(literalNode.getLiteralType()) { case DICE: return ((DiceLiteralNode) literalNode).getValue(); case INTEGER: @@ -63,11 +61,11 @@ public class DiceASTUtils { /** * Convert an literal AST node to an integer, if possible. - * + * * @param tree * The literal node to convert, as a tree * @return The node as an integer - * + * * @throws ClassCastException * if the head of the tree is not a literal (implements * {@link ILiteralDiceNode}) |
