HS: remove parse-cmd callable guard — allow all expression statements (+45 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s

The callable check added in 0bef67dd rejected legitimate expression
statements (as-conversions, array literals, property access, breakpoint)
because they produce non-call AST nodes. The at-end? guard already handles
the trailing-then EOF case; the callable check is redundant and wrong.
Removing it restores the original open fallback: any parse-expr result is
a valid command. arrayLiteral 8/8, breakpoint 2/2, asExpression +35,
evalStatically +5, regressions +3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 16:51:41 +00:00
parent e667d3bc51
commit 85cef7d80f
2 changed files with 33 additions and 20 deletions

View File

@@ -2871,18 +2871,7 @@
(list (quote view-transition!) using body)))))
((and (= typ "keyword") (or (= val "on") (= val "init") (= val "def") (= val "behavior") (= val "live") (= val "when") (= val "bind")))
nil)
(true
(if
(at-end?)
nil
(let
((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"))))))))))
(true (if (at-end?) nil (parse-expr)))))))
(define
parse-cmd-list
(fn