Recover agent-loop progress: lua/prolog/forth/erlang/haskell phases 1-2

Salvaged from worktree-agent-* branches killed during sx-tree MCP outage:
- lua: tokenizer + parser + phase-2 transpile (~157 tests)
- prolog: tokenizer + parser + unification (72 tests, plan update lost to WIP)
- forth: phase-1 reader/interpreter + phase-2 colon/VARIABLE (134 tests)
- erlang: tokenizer + parser (114 tests)
- haskell: tokenizer + parse tests (43 tests)

Cherry-picked file contents only, not branch history, to avoid pulling in
unrelated ocaml-vm merge commits that were in those branches' bases.
This commit is contained in:
2026-04-24 16:03:00 +00:00
parent e274878052
commit 99753580b4
32 changed files with 7803 additions and 36 deletions

32
lib/lua/tests/parse.sx Normal file
View File

@@ -0,0 +1,32 @@
(define
lua-parse-tests
(list
(list "empty" "" (list (quote lua-block)))
(list
"int literal"
"return 42"
(list
(quote lua-block)
(list (quote lua-return) (list (list (quote lua-num) 42)))))
(list
"local"
"local x = 1"
(list
(quote lua-block)
(list
(quote lua-local)
(list "x")
(list (list (quote lua-num) 1)))))
(list
"binop"
"return 1 + 2"
(list
(quote lua-block)
(list
(quote lua-return)
(list
(list
(quote lua-binop)
"+"
(list (quote lua-num) 1)
(list (quote lua-num) 2))))))))