HS: parse-cmd pseudo-command validation — only enforce callable check in non-span mode
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s

In span mode (hs-parse-ast), parse-cmd is used to extract source info from
arbitrary expressions like literals and property access — not just callables.
Guard the "expected function call" error with hs-span-mode so span mode
passes all expression types through, while execution mode still rejects
non-callable expressions.

Also handle span mode's hs-ast dict nodes (kind="call") in the callable?
check, since method calls are wrapped in span mode.
This commit is contained in:
2026-05-05 14:16:29 +00:00
parent 0bef67dd47
commit c26cd500b4

View File

@@ -2874,15 +2874,12 @@
(true
(let
((expr (parse-expr)))
(if
(or
(= (first expr) (quote call))
(= (first expr) (quote method-call)))
expr
(error
(str
"Invalid command — expected a function call, got: "
(str (first 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