diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index 84ee38e1..3a5faded 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -363,6 +363,14 @@ (list (quote not) (list (quote empty?) left))) ((match-kw "in") (list (quote not-in?) left (parse-expr))) + ((match-kw "between") + (let ((lo (parse-atom))) + (match-kw "and") + (let ((hi (parse-atom))) + (list (quote not) + (list (quote and) + (list (quote >=) left lo) + (list (quote <=) left hi)))))) ((match-kw "really") (do (match-kw "equal") @@ -420,6 +428,13 @@ (match-kw "to") (list (quote >=) left (parse-expr))) (list (quote >) left (parse-expr))))) + ((match-kw "between") + (let ((lo (parse-atom))) + (match-kw "and") + (let ((hi (parse-atom))) + (list (quote and) + (list (quote >=) left lo) + (list (quote <=) left hi))))) ((match-kw "in") (list (quote in?) left (parse-expr))) ((match-kw "really") (do @@ -475,6 +490,12 @@ (list (quote =) left right)))))) ((and (= typ "keyword") (= val "exists")) (do (adv!) (list (quote exists?) left))) + ((and (or (= typ "keyword") (= typ "ident")) (= val "starts")) + (do (adv!) (match-kw "with") + (list (quote starts-with?) left (parse-expr)))) + ((and (or (= typ "keyword") (= typ "ident")) (= val "ends")) + (do (adv!) (match-kw "with") + (list (quote ends-with?) left (parse-expr)))) ((and (= typ "keyword") (= val "matches")) (do (adv!) (list (quote matches?) left (parse-expr)))) ((and (= typ "keyword") (= val "contains")) diff --git a/shared/static/wasm/sx/hs-parser.sx b/shared/static/wasm/sx/hs-parser.sx index 84ee38e1..3a5faded 100644 --- a/shared/static/wasm/sx/hs-parser.sx +++ b/shared/static/wasm/sx/hs-parser.sx @@ -363,6 +363,14 @@ (list (quote not) (list (quote empty?) left))) ((match-kw "in") (list (quote not-in?) left (parse-expr))) + ((match-kw "between") + (let ((lo (parse-atom))) + (match-kw "and") + (let ((hi (parse-atom))) + (list (quote not) + (list (quote and) + (list (quote >=) left lo) + (list (quote <=) left hi)))))) ((match-kw "really") (do (match-kw "equal") @@ -420,6 +428,13 @@ (match-kw "to") (list (quote >=) left (parse-expr))) (list (quote >) left (parse-expr))))) + ((match-kw "between") + (let ((lo (parse-atom))) + (match-kw "and") + (let ((hi (parse-atom))) + (list (quote and) + (list (quote >=) left lo) + (list (quote <=) left hi))))) ((match-kw "in") (list (quote in?) left (parse-expr))) ((match-kw "really") (do @@ -475,6 +490,12 @@ (list (quote =) left right)))))) ((and (= typ "keyword") (= val "exists")) (do (adv!) (list (quote exists?) left))) + ((and (or (= typ "keyword") (= typ "ident")) (= val "starts")) + (do (adv!) (match-kw "with") + (list (quote starts-with?) left (parse-expr)))) + ((and (or (= typ "keyword") (= typ "ident")) (= val "ends")) + (do (adv!) (match-kw "with") + (list (quote ends-with?) left (parse-expr)))) ((and (= typ "keyword") (= val "matches")) (do (adv!) (list (quote matches?) left (parse-expr)))) ((and (= typ "keyword") (= val "contains"))