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
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:
@@ -2874,15 +2874,12 @@
|
|||||||
(true
|
(true
|
||||||
(let
|
(let
|
||||||
((expr (parse-expr)))
|
((expr (parse-expr)))
|
||||||
(if
|
(let
|
||||||
(or
|
((callable? (if (and (dict? expr) (get expr :hs-ast)) (= (get expr :kind) "call") (or (= (first expr) (quote call)) (= (first expr) (quote method-call))))))
|
||||||
(= (first expr) (quote call))
|
(if
|
||||||
(= (first expr) (quote method-call)))
|
(or callable? hs-span-mode)
|
||||||
expr
|
expr
|
||||||
(error
|
(error "Invalid command — expected a function call")))))))))
|
||||||
(str
|
|
||||||
"Invalid command — expected a function call, got: "
|
|
||||||
(str (first expr)))))))))))
|
|
||||||
(define
|
(define
|
||||||
parse-cmd-list
|
parse-cmd-list
|
||||||
(fn
|
(fn
|
||||||
|
|||||||
Reference in New Issue
Block a user