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

Allow generating source maps. #702

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Allow generating source maps. #702

merged 4 commits into from
Nov 11, 2024

Conversation

gdotdesign
Copy link
Member

@gdotdesign gdotdesign commented Nov 9, 2024

This PR builds on and supersedes #356 (Mainly the VLQ implementation is brought over).


Developer Notes:

  • Because of the new compiler architecture it was relatively easy to implement.
  • Changes in specs are because the order of resolving entities changed.

TODO:

  • Mappings and sources
  • Wiring to commands (--generate-source-maps flag)
  • Symbol names for the debugger
  • Cleanup pass

The reason for the slowness is Ast::Node#location calculation from offset to line/column, which needs to be calculated when parsing so it will be in a separate PR.

@gdotdesign gdotdesign mentioned this pull request Nov 9, 2024
@gdotdesign gdotdesign self-assigned this Nov 9, 2024
@gdotdesign gdotdesign marked this pull request as draft November 9, 2024 14:23
@gdotdesign gdotdesign added this to the 0.21.0 milestone Nov 9, 2024
@gdotdesign gdotdesign added the tooling Tooling related feature (formatter, documentation, production builder) label Nov 9, 2024
src/utils/vlq.cr Show resolved Hide resolved
@gdotdesign gdotdesign marked this pull request as ready for review November 10, 2024 12:57
@gdotdesign gdotdesign requested a review from Sija November 10, 2024 12:57
src/utils/source_map_generator.cr Outdated Show resolved Hide resolved
src/utils/source_map_generator.cr Outdated Show resolved Hide resolved
src/utils/source_map_generator.cr Outdated Show resolved Hide resolved
src/utils/source_map_generator.cr Outdated Show resolved Hide resolved
src/utils/vlq.cr Outdated Show resolved Hide resolved
src/utils/vlq.cr Outdated Show resolved Hide resolved
@gdotdesign gdotdesign requested a review from Sija November 11, 2024 09:36
@gdotdesign gdotdesign merged commit 2599842 into master Nov 11, 2024
3 checks passed
@gdotdesign gdotdesign deleted the source-maps branch November 11, 2024 17:34
@gdotdesign gdotdesign mentioned this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Tooling related feature (formatter, documentation, production builder)
Development

Successfully merging this pull request may close these issues.

2 participants