Skip to content

Conversation

takikawa
Copy link
Collaborator

@takikawa takikawa commented Oct 8, 2025

This PR adds the draft range mappings spec language to the proposal branch. Once this is merged I'll open a separate PR from the proposal branch to main for detailed comments and review.

Adds a flag to Decoded Mapping Records which indicate if
a mapping is a range mapping. Populate this field based on
the decoded range mapping offsets.
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks overall good, but I didn't do a deep review. Let's get the branch in the repo and then review it properly from there.

1. If the result of performing ComparePositions(_last_.[[GeneratedPosition]], _mapping_.[[GeneratedPosition]]) is ~equal~, then
1. Append _mapping_.[[OriginalPosition]] to _originalPositions_.
1. <ins>If _mapping_.[[IsRangeMapping]] is true, then</ins>
1. <ins>Append GetRangeMappedPosition(_generatedPosition_, _mapping_) to _originalPositions_.</ins>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are looking at the mappings at e here:

abcdefg

and we have none but we have two mappings right before at c, out of which one is the range mappings, maybe we should exclude the non-range one? Since the range one actually ends up being an exact match.

Not exactly sure though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah that's a good point. Excluding the non-range mapping could make sense, but it also seems like it could be unusual to come up in practice so not sure what's the best behavior.

@takikawa
Copy link
Collaborator Author

Thanks for fist pass review, I'll merge it into the branch now and open the PR for detailed review

@takikawa takikawa merged commit 84cb0cd into tc39:proposal-range-mappings Oct 20, 2025
3 checks passed
@takikawa takikawa deleted the range-mappings branch October 20, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants