Skip to main content

Module lang

Module lang 

Source
Expand description

Lang trait:语言适配层。引擎的一切通用逻辑只通过它访问语言 AST。

结构契约:

  • 节点用稳定句柄 Id(语言侧 arena 索引),arena 只追加不回收,Id 永不失效;
  • children 顺序 = 书写/求值顺序(各 kind 的布局见 crate::kind::NodeKind);
  • check 阶段允许追加新节点(arena push),但不得改动既有结构; 结构变更只允许通过 Edit 在应用阶段发生。

Enums§

ReassocOutcome
Lang::reassoc_delta 的合并结果。
StmtKill
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. None means the statement neither reads, shadows, nor dominantly writes the name.

Traits§

Lang