js-on-sx: parser handles comma operator (a, b, c)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s
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:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user