diff options
Diffstat (limited to 'dice-lang/src/main/java/bjc/dicelang/ast/nodes')
3 files changed, 15 insertions, 2 deletions
diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/DiceOperatorType.java b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/DiceOperatorType.java index 76aa2e3..7cc1e42 100644 --- a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/DiceOperatorType.java +++ b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/DiceOperatorType.java @@ -15,6 +15,10 @@ public enum DiceOperatorType { */ MATH, /** + * Represents operators that do things with arrays + */ + ARRAY, + /** * Represents operators that do things with dice */ DICE, diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java index 18df122..411548a 100644 --- a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java +++ b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java @@ -1,6 +1,8 @@ package bjc.dicelang.ast.nodes; -import static bjc.dicelang.ast.nodes.DiceOperatorType.*; +import static bjc.dicelang.ast.nodes.DiceOperatorType.DICE; +import static bjc.dicelang.ast.nodes.DiceOperatorType.EXPRESSION; +import static bjc.dicelang.ast.nodes.DiceOperatorType.MATH; /** * A node that represents an operator @@ -36,12 +38,16 @@ public enum OperatorDiceNode implements IDiceASTNode { /** * Represents constructing an array from a sequence of expressions */ - ARRAY(EXPRESSION), + ARRAY(DiceOperatorType.ARRAY), /** * Represents assigning one node to another */ ASSIGN(EXPRESSION), /** + * Represents calling a function + */ + CALL(EXPRESSION), + /** * Represents evaluating one expression in the context of another */ LET(EXPRESSION); @@ -85,6 +91,8 @@ public enum OperatorDiceNode implements IDiceASTNode { return LET; case "[]": return ARRAY; + case "call": + return CALL; default: throw new IllegalArgumentException( s + " is not a valid operator node"); diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/package-info.java b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/package-info.java index cfa2511..f0f7366 100644 --- a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/package-info.java +++ b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/package-info.java @@ -1,5 +1,6 @@ /** * Classes for nodes in the dice-lang AST + * * @author ben * */ |
