HS: parse-cmd fallback validates pseudo-command is a function call
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
The (true ...) fallback in parse-cmd previously accepted any expression as a command. Now it checks that the parsed expression's head is `call` or `method-call` — the only valid forms for pseudo-commands (foo() or foo.bar()). Any other expression (e.g. foo.bar + bar) raises a parse error instead of silently becoming a no-op. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2871,7 +2871,18 @@
|
||||
(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 (parse-expr))))))
|
||||
(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)))))))))))
|
||||
(define
|
||||
parse-cmd-list
|
||||
(fn
|
||||
|
||||
Reference in New Issue
Block a user