Phase 6a: remove the redundant when and enter keywords
Cohesion audit found two keywords that are pure duplicates:
- `when c { }` produced a byte-identical S_IF to an else-less `if c { }`
(no distinguishing flag) — so it was a second spelling of the same node.
- `enter Name` produced identical codegen to `become Name`: it set an
`ival` flag that emit_become never reads.
Both removed from the parser. `if` already parses with an optional `else`, so
nothing is lost. examples/scenes.ludic (an uncompiled design sketch) and the
LANGUAGE.md scenes section now use `become Name` for scene transitions.
Vocabulary synced (ludic_syntax.h, TextMate grammar, LudicTokens.kt);
check-vocabulary clean. Reseeded (22148 lines); C-free fixpoint holds;
goldens identical; 17/17.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
5ecd300d16
commit
920d476a15
8 changed files with 3406 additions and 3462 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -171,10 +171,6 @@ fn stmt() -> Node {
|
|||
else { pi = save } # no else: keep the separator for block()'s Rule-B check
|
||||
return n
|
||||
}
|
||||
if streq(t.text, "when") { # `when c { }` — an if with no else
|
||||
pi = pi + 1; let n = node(S_IF); n.a = expr(); n.b = block()
|
||||
return n
|
||||
}
|
||||
if streq(t.text, "while") { pi = pi + 1; let n = node(S_WHILE); n.a = expr(); n.b = block(); return n }
|
||||
if streq(t.text, "for") {
|
||||
pi = pi + 1
|
||||
|
|
@ -198,7 +194,6 @@ fn stmt() -> Node {
|
|||
eat_op("}"); return n
|
||||
}
|
||||
if streq(t.text, "become") { pi = pi + 1; let n = node(S_BECOME); n.s = eat_id(); return n }
|
||||
if streq(t.text, "enter") { pi = pi + 1; let n = node(S_BECOME); n.s = eat_id(); n.ival = 1; return n }
|
||||
if streq(t.text, "despawn") { pi = pi + 1; let n = node(S_DESPAWN); n.a = expr(); return n }
|
||||
if streq(t.text, "enable") or streq(t.text, "disable") {
|
||||
let en = 0; if streq(t.text, "enable") { en = 1 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue