Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add qualifying references to identifier references
There are multiple pieces in the codebase that need information about the qualifying reference/declaration of a reference, e.g. to determine whether the reference is a member access on the return value of a specific member. Currently, checking this is achieved by navigating the parse tree each time, also taking into account with blocks. This commit moves the qualifier resolution to the BoundExpressionVisitor, which already has all the information present to easily determine the qualifying reference. The following qualifier structure has been implemented: - Member accesses are qualified by the reference for their lExpression. - Member accesses return their own reference as the one qualifying a potential access. - For (recursive) default member accesses the innermost access is qualified by the reference of the lExpression and each other access is qualified by the immediately contained one. - For (recursive) default member accesses the outermost access is returned as potentially qualifying. - Array accessed are qualified by the reference of their lExpression (potentially with default member accesses in between), i.e. by the reference of the array variable or array returning member. - Array accesses return themselves as potentially qualifying. (To get the array, one has to go up the chain again.) - Index accesses other than array and default member accesses are qualified by the reference of their lExpression. - Index accesses other than array and default member accesses return the reference of their lExpression as potentially qualifying. - Dictionary access expressions work like default member access expressions. - Other expressions neither take nor return a reference as (potentially) qualifying.
- Loading branch information