diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index 25aea140..15e05503 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -2871,7 +2871,28 @@ (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 (parse-expr))))))) + (true + (if + (at-end?) + nil + (let + ((expr (parse-expr))) + (if + (if + (and (dict? expr) (get expr :hs-ast)) + (= (get expr :kind) "arith") + (and + (list? expr) + (let + ((h (first expr))) + (or + (= h (quote +)) + (= h (quote -)) + (= h (quote *)) + (= h (quote /)) + (= h (make-symbol "%")))))) + (error "Pseudo-commands must be function calls") + expr)))))))) (define parse-cmd-list (fn diff --git a/shared/static/wasm/sx/hs-parser.sx b/shared/static/wasm/sx/hs-parser.sx index 25aea140..15e05503 100644 --- a/shared/static/wasm/sx/hs-parser.sx +++ b/shared/static/wasm/sx/hs-parser.sx @@ -2871,7 +2871,28 @@ (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 (parse-expr))))))) + (true + (if + (at-end?) + nil + (let + ((expr (parse-expr))) + (if + (if + (and (dict? expr) (get expr :hs-ast)) + (= (get expr :kind) "arith") + (and + (list? expr) + (let + ((h (first expr))) + (or + (= h (quote +)) + (= h (quote -)) + (= h (quote *)) + (= h (quote /)) + (= h (make-symbol "%")))))) + (error "Pseudo-commands must be function calls") + expr)))))))) (define parse-cmd-list (fn