-
Notifications
You must be signed in to change notification settings - Fork 1
Handle RBSLocation and RBSLocationList types #58
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
Handle RBSLocation and RBSLocationList types #58
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
vinistock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Just a small question about the data type for the start and end byte positions.
rust/ruby-rbs/src/lib.rs
Outdated
| pub fn start_loc(&self) -> usize { | ||
| unsafe { (*self.pointer).rg.start.byte_pos as usize } | ||
| } | ||
|
|
||
| pub fn end_loc(&self) -> usize { | ||
| unsafe { (*self.pointer).rg.end.byte_pos as usize } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the original type of byte_pos? I noticed we're casting it to usize, but if this is a smaller type (like u32), I'd say we keep that for lower memory usage and clients of the API can decide if they want to broaden the type.
Many AST nodes in config.yml have location fields (rbs_location, rbs_location_list). This change adds the necessary wrapper structs (RBSLocation, RBSLocationList) and updates build.rs to generate accessors for these fields. The RBSLocation wrapper includes a reference to the parser to support future functionality like source extraction.
82f84a2 to
090c099
Compare
Many AST nodes in `config.yml` have location fields (`rbs_location`, `rbs_location_list`). This change adds the necessary wrapper structs (`RBSLocation`, `RBSLocationList`) and updates `build.rs` to generate accessors for these fields. The `RBSLocation` wrapper includes a reference to the parser to support future functionality like source extraction.
Many AST nodes in `config.yml` have location fields (`rbs_location`, `rbs_location_list`). This change adds the necessary wrapper structs (`RBSLocation`, `RBSLocationList`) and updates `build.rs` to generate accessors for these fields. The `RBSLocation` wrapper includes a reference to the parser to support future functionality like source extraction.
Many AST nodes in `config.yml` have location fields (`rbs_location`, `rbs_location_list`). This change adds the necessary wrapper structs (`RBSLocation`, `RBSLocationList`) and updates `build.rs` to generate accessors for these fields. The `RBSLocation` wrapper includes a reference to the parser to support future functionality like source extraction.

Many AST nodes in
config.ymlhave location fields (rbs_location,rbs_location_list). This change adds the necessary wrapper structs (RBSLocation,RBSLocationList) and updatesbuild.rsto generate accessors for these fields.The
RBSLocationwrapper includes a reference to the parser to support future functionality like source extraction.