Generate VariableAccesses also for defining accesses

This commit is contained in:
Tom Hvitved
2020-12-01 14:39:41 +01:00
parent bde9f59e0e
commit 9820dcb363
4 changed files with 70 additions and 6 deletions

View File

@@ -60,11 +60,7 @@ class VariableAccess extends AstNode, @token_identifier {
override Generated::Identifier generated;
Variable variable;
VariableAccess() {
access(this, variable) and
// Do not generate an access at the defining location
not variable = TLocalVariable(_, _, this)
}
VariableAccess() { access(this, variable) }
/** Gets the variable this identifier refers to. */
Variable getVariable() { result = variable }