-
Notifications
You must be signed in to change notification settings - Fork 177
Introduce using slices instead of locations #3772
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
base: main
Are you sure you want to change the base?
Conversation
ae0f2eb to
02d92c7
Compare
Can you explain this a bit? To me it seems most convenient to have it done relatively quickly so that consumers don't have to bother with both variants. Eventually this needs changes in ruby/ruby to compile which will make backporting prism versions a bit annoying, so it would be nice if its not spread across many commits in ruby/ruby I think |
|
(For posterity, linking this to #1566 .) |
Yeah this is a good point. Let's just keep it around for the lifetime of this PR while things get migrated, and then we can squash it all before merge. |
929df4d to
c12168e
Compare
In the C API, we want to use slices instead of locations in the AST. In this case a "slice" is effectively the same thing as the location, expect it is represented using a 32-bit offset and a 32-bit length. This will cut down on half of the space of all of the locations in the AST. I am introducing this as a new field type to ease the migration path, so that this can be merged on its own and then fields can be moved one at a time. Note that from the Ruby/Java/JavaScript side, this is effectively an invisible change. This only impacts the C/Rust side.
e257fa9 to
ef86059
Compare
|
Just to put this explicitly: not merging this until after Christmas/Ruby 4.0 is released. |
In the C API, we want to use slices instead of locations in the AST. In this case a "slice" is effectively the same thing as the location, expect it is represented using a 32-bit offset and a 32-bit length. This will cut down on half of the space of all of the locations in the AST.
I am introducing this as a new field type to ease the migration path, so that this can be merged on its own and then fields can be moved one at a time.
Note that from the Ruby/Java/JavaScript side, this is effectively an invisible change. This only impacts the C/Rust side.
Fixes #1566