| name | gen-langue |
| description | Update Lumo .langue definition files and regenerate the lumo-syntax crate. Use when changing syntax, elab rules, judgments, or the compiler grammar. |
| allowed-tools | Bash(cargo run *) Bash(bash scripts/verify.sh) Read Edit Write Glob Grep |
Langue Definition Update Workflow
The language definition under the repo-root lumo/ directory is the
source of truth (D-01); crates/lumo-syntax/src is generated from it
by langc. When the definition changes, regenerate.
Workflow
-
Edit the .langue files under lumo/:
Lumo.tokens/item/expr.syn.langue — Lumo surface syntax
MIR.syn.langue, MIR.type.langue — MIR grammar + judgments
JS.syn.langue — the JS emission subset
lumo/elab/*.elab.langue — elaboration rules (derived rules,
extern rule / extern pass declarations)
lumo.langue — the manifest pipe
-
Check, then regenerate:
cargo run -j 2 -q -p langc -- check lumo
cargo run -j 2 -q -p langc -- gen lumo -o crates/lumo-syntax/src
-
Implement any new externs by hand in
crates/lumo-syntax/src/elab_externs.rs (generated Externs
traits have no defaults — missing impls fail the build, D-01).
-
Verify — check + gen-freshness + full workspace tests
(corpus fixtures included; bless with LANGC_UPDATE=1, which only
fills missing expected blocks):
bash scripts/verify.sh
Key rules
- Never edit generated files under
crates/lumo-syntax/src (they
carry an "Auto-generated by langc gen" header); elab_externs.rs,
judge_driver.rs, compile_driver.rs, and tests/ are the
handwritten exceptions.
- Generated code is committed (D-21);
scripts/verify.sh fails if it
drifts from the definition.
- Keep
-j 2 — parallel rustc OOMs this machine.
- The legacy workflow this skill used to describe
(
scripts/gen_langue.sh, crates/compiler/lumo.langue,
packages/langue/dist/langue.js) is gone with the Langue 2 rewrite.