js-on-sx: parser accepts labels (drops label) + optional ident on break/continue
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 27s

This commit is contained in:
2026-05-09 16:31:20 +00:00
parent d1482482ff
commit 3d821d1290
2 changed files with 22 additions and 2 deletions

View File

@@ -1431,9 +1431,27 @@
((jp-at? st "keyword" "for") (jp-parse-for-stmt st))
((jp-at? st "keyword" "return") (jp-parse-return-stmt st))
((jp-at? st "keyword" "break")
(do (jp-advance! st) (jp-eat-semi st) (list (quote js-break))))
(do
(jp-advance! st)
(cond
((= (get (jp-peek st) :type) "ident")
(do (jp-advance! st) (jp-eat-semi st) (list (quote js-break))))
(else (do (jp-eat-semi st) (list (quote js-break)))))))
((jp-at? st "keyword" "continue")
(do (jp-advance! st) (jp-eat-semi st) (list (quote js-continue))))
(do
(jp-advance! st)
(cond
((= (get (jp-peek st) :type) "ident")
(do (jp-advance! st) (jp-eat-semi st) (list (quote js-continue))))
(else (do (jp-eat-semi st) (list (quote js-continue)))))))
((and
(= (get (jp-peek st) :type) "ident")
(= (get (jp-peek-at st 1) :type) "punct")
(= (get (jp-peek-at st 1) :value) ":"))
(do
(jp-advance! st)
(jp-advance! st)
(jp-parse-stmt st)))
((jp-at? st "keyword" "class") (jp-parse-class-decl st))
((jp-at? st "keyword" "throw") (jp-parse-throw-stmt st))
((jp-at? st "keyword" "try") (jp-parse-try-stmt st))