From 635d3150e3e85c01b777ff165e21fa8965d58440 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:08:11 -0400 Subject: Cleanup --- .../bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java') diff --git a/dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java b/dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java index ece528b..5a3f5b3 100644 --- a/dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java +++ b/dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java @@ -2,14 +2,14 @@ package bjc.dicelang.v1.ast.nodes; /** * Represents a literal of some type in the AST - * + * * @author ben * */ public interface ILiteralDiceNode extends IDiceASTNode { /** * Check if a token represents a literal, and if so, what type - * + * * @param tok * The token to check * @return The type the literal would be if it is one, or null otherwise @@ -19,18 +19,15 @@ public interface ILiteralDiceNode extends IDiceASTNode { String diceGroupOrNumber = "[(?:" + diceGroup + ")(?:\\d+)]"; - if (tok.matches("\\A" + diceGroupOrNumber + "?" + "c" + diceGroupOrNumber + "\\Z")) { + if(tok.matches("\\A" + diceGroupOrNumber + "?" + "c" + diceGroupOrNumber + "\\Z")) return DiceLiteralType.DICE; - } - if (tok.matches("\\A" + diceGroup + "Z")) { - return DiceLiteralType.DICE; - } + if(tok.matches("\\A" + diceGroup + "Z")) return DiceLiteralType.DICE; try { Integer.parseInt(tok); return DiceLiteralType.INTEGER; - } catch (NumberFormatException nfex) { + } catch(NumberFormatException nfex) { // We don't care about details // This probably shouldn't return null, but I believe it // does so @@ -41,7 +38,7 @@ public interface ILiteralDiceNode extends IDiceASTNode { /** * Check if this node can be optimized to a constant - * + * * @return Whether or not this node can be optimized to a constant * @see bjc.dicelang.v1.IDiceExpression#canOptimize() */ @@ -49,7 +46,7 @@ public interface ILiteralDiceNode extends IDiceASTNode { /** * Get the type of literal this node represents - * + * * @return The type of literal this node represents */ DiceLiteralType getLiteralType(); @@ -66,7 +63,7 @@ public interface ILiteralDiceNode extends IDiceASTNode { /** * Optimize this node to a constant if possible - * + * * @return This node in constant form if possible * @see bjc.dicelang.v1.IDiceExpression#optimize() */ -- cgit v1.2.3