Scopes: Update encoding to 'tags' approach #171
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 changes the encoding of the "Scopes" proposal to the "Tag" approach presented in the TG4 meeting of 2024-01-30 (see slides.
The information contained is exactly the same, we just use a different encoding scheme to be future-proof.
The PR includes some changes w.r.t. to the slides. These are of course up for discussion:
"expressions"
rather than piggy-backing on"names"
. This was discussed in some forums. I'm not 100% sure about this as some strings may end up twice in the source map this way. Especially if no variable renaming happened.original_scope_source_index
item that can be used to connect a root original scope tree with a specific source file. A second way is to include exactly as many root original scope trees as there are source files, so the connection is implicit via indices. The generator can choose the approach.FLAGS
inoriginal_scope_start
to the beginning to. be more consistent withgenerated_range_start
.DEFINITION
ingenerated_range_start
is not an item index, but rather the nthoriginal_scope_start
item to further reduce the magnitude of the value.The wording is still ambiguous in some cases, but should be (mostly) enough for the proposal doc.