summaryrefslogtreecommitdiff
path: root/dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java
diff options
context:
space:
mode:
authorEVE <EVE@EVE-PC>2017-03-14 12:08:11 -0400
committerEVE <EVE@EVE-PC>2017-03-14 12:08:11 -0400
commit635d3150e3e85c01b777ff165e21fa8965d58440 (patch)
tree3389128f83a5a79f8d0eec0a0e19f54b9d117b66 /dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java
parente59e2a97773f93bdd25bd4680809c10699f0feb3 (diff)
Cleanup
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java')
-rw-r--r--dice-lang/src/bjc/dicelang/v1/ast/nodes/ILiteralDiceNode.java19
1 files changed, 8 insertions, 11 deletions
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()
*/