Skip to content

Conversation

@alexcrocha
Copy link

@alexcrocha alexcrocha commented Nov 19, 2025

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.

Copy link
Author

alexcrocha commented Nov 19, 2025

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@alexcrocha alexcrocha marked this pull request as ready for review November 19, 2025 00:43
Copy link
Member

@vinistock vinistock left a 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.

Comment on lines 90 to 96
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 }
}
Copy link
Member

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.
@alexcrocha alexcrocha force-pushed the Add_RBSLocation_and_RBSLocationList_types_to_Rust_RBS_bindings branch from 82f84a2 to 090c099 Compare November 19, 2025 22:34
@alexcrocha alexcrocha merged commit ea7ec90 into ar-rust-rbs-build Nov 19, 2025
16 of 27 checks passed
alexcrocha added a commit that referenced this pull request Jan 13, 2026
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.
alexcrocha added a commit that referenced this pull request Jan 13, 2026
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.
alexcrocha added a commit that referenced this pull request Jan 14, 2026
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.
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