js-on-sx: parser handles comma operator (a, b, c)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s

Was failing with "Expected punct ')' got punct ','" because the
paren handler only consumed a single assignment. Added
jp-parse-comma-seq helpers that build a js-comma AST node with
the expression list; transpiler emits (begin ...) so each is
evaluated in order and the last value is returned.
built-ins/Object: 44/50 → 46/50. conformance.sh: 148/148.
This commit is contained in:
2026-05-08 13:20:53 +00:00
parent b7627b4102
commit 4ab79f5758
5 changed files with 48 additions and 28 deletions

View File

@@ -165,6 +165,8 @@
(js-transpile-new (nth ast 1) (nth ast 2)))
((js-tag? ast "js-class")
(js-transpile-class (nth ast 1) (nth ast 2) (nth ast 3)))
((js-tag? ast "js-comma")
(cons (js-sym "begin") (map js-transpile (nth ast 1))))
((js-tag? ast "js-throw") (js-transpile-throw (nth ast 1)))
((js-tag? ast "js-try")
(js-transpile-try (nth ast 1) (nth ast 2) (nth ast 3)))