Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions rust/ruby-rbs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,20 @@ fn generate(config: &Config) -> Result<(), Box<dyn Error>> {
)?;
writeln!(file, " }}")?;
writeln!(file, " }}")?;
writeln!(file)?;
writeln!(file, " /// Returns the location of the entire node.")?;
writeln!(file, " #[must_use]")?;
writeln!(file, " pub fn location(&self) -> RBSLocation {{")?;
writeln!(file, " match self {{")?;
for node in &config.nodes {
writeln!(
file,
" Node::{}(node) => node.location(),",
node.variant_name()
)?;
}
writeln!(file, " }}")?;
writeln!(file, " }}")?;
writeln!(file, "}}")?;
writeln!(file)?;

Expand Down
Loading