Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Extract 'generatedPosition' and 'originalPosition' structs #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

szuend
Copy link
Collaborator

@szuend szuend commented Nov 13, 2024

This PR introduces two new structs generated position and original position and uses them in the decoded mapping struct instead of inlined line/column/sources. This has a couple of advantages:

  • We make it explicit with the "types" that for original position in a mapping entry either all (source, line, column) are null or a non-negative integer. Otherwise it's only implicitly defined by the decoding algorithm.
  • We can re-use both in the definition for "original scopes" (start, end) and "generated ranges" (start, end callsite).
  • We can re-use both in various algorithms we'll declare (both for scopes and how to apply mappings).

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.

1 participant