Add sibling sublist parser tests + reset JIT sx-parse

Tests: parse "(a (b) (c))" must produce 3 siblings, not nested.
Catches JIT compilation bug where closing parens cause sibling
lists to become children.

Reset sx-parse to CEK on the OCaml kernel — the JIT-compiled
version of sx-parse's complex letrec produces wrong bytecode.
CEK interpretation works correctly (tests pass on all platforms).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 19:17:05 +00:00
parent 890c472893
commit 96f50b9dfa
2 changed files with 23 additions and 0 deletions

View File

@@ -79,6 +79,19 @@
(assert-length 1 result)
(assert-equal (list 1 (list 2 3) 4) (first result))))
(deftest "parse sibling sublists"
;; Regression: closing paren of (b) must not swallow (c) as a child
(let ((result (sx-parse "(a (b) (c))")))
(assert-length 1 result)
(assert-length 3 (first result))
(assert-equal (list (make-symbol "a") (list (make-symbol "b")) (list (make-symbol "c")))
(first result))))
(deftest "parse multiple sibling sublists with content"
(let ((result (sx-parse "(div (span 1) (span 2) (span 3))")))
(assert-length 1 result)
(assert-length 4 (first result))))
(deftest "parse square brackets as list"
(let ((result (sx-parse "[1 2 3]")))
(assert-length 1 result)