Files
endorphin-aster-vm/crates/frontend/src/ast/README.md
T
codex-bot f5268d2e09
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 7m55s
feat: generate unified AST and editor contracts from ASDL
2026-10-19 14:31:28 +08:00

12 lines
894 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ASDL 生成的 AST 与接口
本目录只保存 frontend 的语法数据与遍历/交换接口,不定义运行时对象。
| 文件 | 职责 |
| --- | --- |
| [generated.rs](generated.rs) | 从 Endor.asdl 生成的节点类型、Serde 实现、Spanned 实现和 AST_SCHEMA_ID |
| [visitor.rs](visitor.rs) | 同源生成的可失败 Visitor、节点进入/离开钩子与 walk_* 默认遍历 |
| [wire.rs](wire.rs) | 手写 AstDocument JSON 接口、schema ID、范围与父子位置校验 |
唯一节点定义源是 [Endor.asdl](../../Endor.asdl),生成命令为 `python3 scripts/generate_ast.py --write`,在仓库根运行;--check 仅检查产物是否同步,不执行语言或测试。不要直接编辑 generated.rs/visitor.rs。公开入口见 [ast.rs](../ast.rs),完整契约见 [AST 模型](../../../../docs/runtime/ast.md)。返回 [frontend/src](../README.md)。