Phase 6a: rename core vocabulary (game/main/component/archetype/system)
game/module -> program, main -> entry, component -> property, archetype -> model, system -> handler. Done via a transitional self-hosting bootstrap: parser accepts both -> reseed -> compiler source moved to new keywords + parser tightened to new-only -> reseed (fixpoint holds). Old keywords now rejected. Token-safe corpus migration (tools/ludic-tools/rename_kw.c) leaves the LLVM @main/entry: labels in emit strings untouched; goldens byte-identical. Editor vocab (header/JetBrains/TextMate/emacs), check-docs wrapper, and doc fences updated; error string 'unknown component' -> 'unknown property'. test.sh 14/14, test-tools 28/0, check-vocabulary green. (Doc prose pass to follow.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
3227e1e1d3
commit
42f955fd22
35 changed files with 2632 additions and 2646 deletions
|
|
@ -3,10 +3,10 @@
|
|||
# general: compiled by the SAME unmodified ludicc + runtime as the JRPG.
|
||||
# No sprites/assets — pure primitives. Build: ./build.sh examples/snake.ludic
|
||||
# ============================================================================
|
||||
game Snake {
|
||||
program Snake {
|
||||
|
||||
component Pos { x: int = 0, y: int = 0 }
|
||||
component Seg { order: int = 0 }
|
||||
property Pos { x: int = 0, y: int = 0 }
|
||||
property Seg { order: int = 0 }
|
||||
|
||||
const GW: int = 20
|
||||
const GH: int = 15
|
||||
|
|
@ -39,9 +39,9 @@ game Snake {
|
|||
return 0
|
||||
}
|
||||
|
||||
system Boot phase Start { reset(0) }
|
||||
handler Boot phase Start { reset(0) }
|
||||
|
||||
system Input phase Input {
|
||||
handler Input phase Input {
|
||||
let k = key()
|
||||
if reg(R_MODE) == 0 {
|
||||
if k == 'w' { if reg(R_DIR) != 1 { setreg(R_DIR, 0) } }
|
||||
|
|
@ -55,7 +55,7 @@ game Snake {
|
|||
}
|
||||
}
|
||||
|
||||
system Move phase Update {
|
||||
handler Move phase Update {
|
||||
if reg(R_MODE) == 0 {
|
||||
setreg(R_TICK, reg(R_TICK) + 1)
|
||||
if reg(R_TICK) >= 6 {
|
||||
|
|
@ -110,7 +110,7 @@ game Snake {
|
|||
}
|
||||
}
|
||||
|
||||
system Draw phase Render {
|
||||
handler Draw phase Render {
|
||||
clear(0x0d1020)
|
||||
for gy in 0 .. GH {
|
||||
for gx in 0 .. GW {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue