lua: re-apply arch's GUEST-lex prefix-rename refactor on top of merged loops/lua
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s
Lua now joins tcl/ocaml/kernel/common-lisp in consuming lib/guest/lex.sx via prefix-rename. Removes 28 lines of duplicated character-class helpers (lua-make-token, lua-digit?, lua-hex-digit?, lua-letter?, lua-ident-start?, lua-ident-char?, lua-ws?) and replaces with the 8-line prefix-rename block. The byte-table additions from loops/lua (__ascii-tok, __lua-127-255-tok, lua-byte-to-char) are preserved at the top of tokenizer.sx — those provide Lua's 8-bit-clean string semantics on top of the shared lex layer. test.sh updated to preload lib/guest/lex.sx + lib/guest/prefix.sx before lua sources, matching the load order arch's pre-merge test.sh used. 393/395 maintained. The 2 pre-existing failures are unrelated: - math.random(n) primitive arity issue - os.clock returns rational instead of number (SX division semantics) Skipped from the planned follow-up: delay/force port. Arch's lua-force was defined but never referenced anywhere — dead code, not worth porting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,10 @@ TMPFILE=$(mktemp)
|
||||
trap "rm -f $TMPFILE" EXIT
|
||||
|
||||
cat > "$TMPFILE" << 'EPOCHS'
|
||||
(epoch 0)
|
||||
(load "lib/guest/lex.sx")
|
||||
(epoch 0a)
|
||||
(load "lib/guest/prefix.sx")
|
||||
(epoch 1)
|
||||
(load "lib/lua/tokenizer.sx")
|
||||
(epoch 2)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user