diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index 5be81c1f..cdc40b60 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -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