diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index d1413bbd..62a6434c 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -987,7 +987,7 @@ (do (when (and - (number? left) + (or (number? left) (list? left)) (= (tp-type) "ident") (not (or @@ -3113,7 +3113,23 @@ (let ((inner (parse-feat))) (if (= (tp-type) "paren-close") (adv!) nil) - inner))) + (if + (and + inner + (or + (and + (= (tp-type) "ident") + (not + (or + (= (tp-val) "then") + (= (tp-val) "end") + (= (tp-val) "else") + (= (tp-val) "otherwise")))) + (and (= (tp-type) "op") (= (tp-val) "%")))) + (let + ((unit (tp-val))) + (do (adv!) (list (quote string-postfix) inner unit))) + inner)))) ((= val "on") (do (adv!) (parse-on-feat))) ((= val "init") (do (adv!) (parse-init-feat))) ((= val "def") (do (adv!) (parse-def-feat))) diff --git a/shared/static/wasm/sx/hs-parser.sx b/shared/static/wasm/sx/hs-parser.sx index d1413bbd..62a6434c 100644 --- a/shared/static/wasm/sx/hs-parser.sx +++ b/shared/static/wasm/sx/hs-parser.sx @@ -987,7 +987,7 @@ (do (when (and - (number? left) + (or (number? left) (list? left)) (= (tp-type) "ident") (not (or @@ -3113,7 +3113,23 @@ (let ((inner (parse-feat))) (if (= (tp-type) "paren-close") (adv!) nil) - inner))) + (if + (and + inner + (or + (and + (= (tp-type) "ident") + (not + (or + (= (tp-val) "then") + (= (tp-val) "end") + (= (tp-val) "else") + (= (tp-val) "otherwise")))) + (and (= (tp-type) "op") (= (tp-val) "%")))) + (let + ((unit (tp-val))) + (do (adv!) (list (quote string-postfix) inner unit))) + inner)))) ((= val "on") (do (adv!) (parse-on-feat))) ((= val "init") (do (adv!) (parse-init-feat))) ((= val "def") (do (adv!) (parse-def-feat)))