Add symbol name to bound kinds

The `Get`, `DefLocal`, and `DefGlobal` bound kinds now store the symbol
name associated with the variable. This information is useful for
debugging and provides more context in the compiled output.
This commit is contained in:
Michael Schimmel
2026-02-19 16:25:17 +01:00
parent 98668cc683
commit e7628e5cdf
7 changed files with 52 additions and 37 deletions
+4 -4
View File
@@ -95,15 +95,15 @@ impl TCO {
..node
}
},
BoundKind::DefLocal { slot, value, captured_by } => {
BoundKind::DefLocal { name, slot, value, captured_by } => {
Node {
kind: BoundKind::DefLocal { slot, value: Box::new(Self::transform(*value, false)), captured_by },
kind: BoundKind::DefLocal { name, slot, value: Box::new(Self::transform(*value, false)), captured_by },
..node
}
},
BoundKind::DefGlobal { global_index, value } => {
BoundKind::DefGlobal { name, global_index, value } => {
Node {
kind: BoundKind::DefGlobal { global_index, value: Box::new(Self::transform(*value, false)) },
kind: BoundKind::DefGlobal { name, global_index, value: Box::new(Self::transform(*value, false)) },
..node
}
},