Add support for local reference targets #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR intended to be no-op for the end-user.
It introduces the concept of "local references", which can be utilised for
count.index
,each.*
andself.*
references, as drafted within #149While there are tests attached, there is no code actually collecting such local targets - that is left for follow-up PRs which can be made out of the linked PR.
It also leaves out the question of rendering such reference targets. Now that there can be two ways of referring to the same target, there can be some contexts where it is appropriate to use one address over the other, and vice versa. I could not find any way to solve that problem in an abstract sense which would work for all three use cases. So I left this for the follow-up PRs. I did however leave TODOs in a few places where it is likely this problem will need to be addressed + I introduced an
Address()
method toreference.Target
, which should essentially "just work" for the simpler cases ofcount.index
andeach.*
.