summaryrefslogtreecommitdiff
path: root/dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java
diff options
context:
space:
mode:
Diffstat (limited to 'dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java')
-rw-r--r--dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java b/dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java
index aaabe8b..a74d61e 100644
--- a/dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java
+++ b/dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java
@@ -23,8 +23,7 @@ public final class DiceASTReferenceChecker
* Create a new reference checker
*
* @param referencesVar
- * The holder of whether the variable is referenced or
- * not
+ * The holder of whether the variable is referenced or not
* @param varName
* The variable to check for references in
*/
@@ -37,21 +36,20 @@ public final class DiceASTReferenceChecker
@Override
public void accept(IDiceASTNode astNode) {
if (!referencesVariable.unwrap(bool -> bool)) {
- if (isDirectReferenceToLast(astNode)) {
+ if (isDirectReference(astNode)) {
referencesVariable.transform((bool) -> false);
}
}
}
/**
- * Check if a given AST node directly references the meta-variable
- * last
+ * Check if a given AST node directly references the specified variable
*
* @param astNode
* The node to check
- * @return Whether or not the node directly references last
+ * @return Whether or not the node directly the variable
*/
- private boolean isDirectReferenceToLast(IDiceASTNode astNode) {
+ private boolean isDirectReference(IDiceASTNode astNode) {
if (astNode.getType() == DiceASTType.VARIABLE) {
VariableDiceNode node = (VariableDiceNode) astNode;