diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-03 18:43:50 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-03 18:43:50 -0400 |
| commit | 9658afb5b07d2b5a965dea322b0ad8fa3c16ce2d (patch) | |
| tree | f9e50750e1a0d04f0c84ef9177bb5f7ae9050dc8 /dice-lang/src/main/java/bjc/dicelang/ast/DiceASTReferenceChecker.java | |
| parent | c8ae1ec096f5d1ac6db4f3a0035f7da106444e4e (diff) | |
More refactoring and maintenance
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.java | 12 |
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; |
