Expand description
Lang trait:语言适配层。引擎的一切通用逻辑只通过它访问语言 AST。
结构契约:
- 节点用稳定句柄
Id(语言侧 arena 索引),arena 只追加不回收,Id永不失效; - children 顺序 = 书写/求值顺序(各 kind 的布局见
crate::kind::NodeKind); check阶段允许追加新节点(arena push),但不得改动既有结构; 结构变更只允许通过Edit在应用阶段发生。
Enums§
- Reassoc
Outcome Lang::reassoc_delta的合并结果。- Stmt
Kill - Result of scanning one statement for a name: any-path reads keep the
init alive, shadowing declarations reject, and a dominating simple
assignment kills it.
Nonemeans the statement neither reads, shadows, nor dominantly writes the name.