HS: parse-cmd at-end? guard + catch do-wrap fix asyncError (+2 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s
- parser.sx: parse-cmd true-fallback returns nil when at-end? instead of calling parse-expr at EOF — fixes trailing 'then' causing compilation error for 'on ... then' terminated handlers - compiler.sx: catch-without-finally branch wraps guard+reraise in do so both expressions are sequenced inside the let binding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2872,14 +2872,17 @@
|
||||
((and (= typ "keyword") (or (= val "on") (= val "init") (= val "def") (= val "behavior") (= val "live") (= val "when") (= val "bind")))
|
||||
nil)
|
||||
(true
|
||||
(let
|
||||
((expr (parse-expr)))
|
||||
(if
|
||||
(at-end?)
|
||||
nil
|
||||
(let
|
||||
((callable? (if (and (dict? expr) (get expr :hs-ast)) (= (get expr :kind) "call") (or (= (first expr) (quote call)) (= (first expr) (quote method-call))))))
|
||||
(if
|
||||
(or callable? hs-span-mode)
|
||||
expr
|
||||
(error "Invalid command — expected a function call")))))))))
|
||||
((expr (parse-expr)))
|
||||
(let
|
||||
((callable? (if (and (dict? expr) (get expr :hs-ast)) (= (get expr :kind) "call") (or (= (first expr) (quote call)) (= (first expr) (quote method-call))))))
|
||||
(if
|
||||
(or callable? hs-span-mode)
|
||||
expr
|
||||
(error "Invalid command — expected a function call"))))))))))
|
||||
(define
|
||||
parse-cmd-list
|
||||
(fn
|
||||
|
||||
Reference in New Issue
Block a user