mirror of
https://github.com/metosin/reitit.git
synced 2026-02-01 18:30:33 +00:00
Merge pull request #770 from lucacervello/master
Some checks failed
testsuite / Clojure 11 (Java 11) (push) Has been cancelled
testsuite / Clojure 11 (Java 17) (push) Has been cancelled
testsuite / Clojure 11 (Java 21) (push) Has been cancelled
testsuite / Clojure 11 (Java 25) (push) Has been cancelled
testsuite / Clojure 12 (Java 11) (push) Has been cancelled
testsuite / Clojure 12 (Java 17) (push) Has been cancelled
testsuite / Clojure 12 (Java 21) (push) Has been cancelled
testsuite / Clojure 12 (Java 25) (push) Has been cancelled
testsuite / ClojureScript (push) Has been cancelled
testsuite / Lint cljdoc.edn (push) Has been cancelled
testsuite / Check cljdoc analysis (push) Has been cancelled
Some checks failed
testsuite / Clojure 11 (Java 11) (push) Has been cancelled
testsuite / Clojure 11 (Java 17) (push) Has been cancelled
testsuite / Clojure 11 (Java 21) (push) Has been cancelled
testsuite / Clojure 11 (Java 25) (push) Has been cancelled
testsuite / Clojure 12 (Java 11) (push) Has been cancelled
testsuite / Clojure 12 (Java 17) (push) Has been cancelled
testsuite / Clojure 12 (Java 21) (push) Has been cancelled
testsuite / Clojure 12 (Java 25) (push) Has been cancelled
testsuite / ClojureScript (push) Has been cancelled
testsuite / Lint cljdoc.edn (push) Has been cancelled
testsuite / Check cljdoc analysis (push) Has been cancelled
Allow colons in bracket parameter syntax
This commit is contained in:
commit
248200aad3
2 changed files with 16 additions and 2 deletions
|
|
@ -71,11 +71,17 @@
|
||||||
|
|
||||||
(and bracket? (= \{ c))
|
(and bracket? (= \{ c))
|
||||||
(let [^long to' (or (str/index-of s "}" to) (ex/fail! ::unclosed-brackets {:path s}))]
|
(let [^long to' (or (str/index-of s "}" to) (ex/fail! ::unclosed-brackets {:path s}))]
|
||||||
(if (= \* (get s (inc to)))
|
(cond
|
||||||
|
(= \* (get s (inc to)))
|
||||||
(recur (concat ss (-static from to) (-catch-all (inc to) to')) (long (inc to')) (long (inc to')))
|
(recur (concat ss (-static from to) (-catch-all (inc to) to')) (long (inc to')) (long (inc to')))
|
||||||
|
|
||||||
|
(= \: (get s (inc to)))
|
||||||
|
(recur (concat ss (-static from to) (-wild (inc to) to')) (long (inc to')) (long (inc to')))
|
||||||
|
|
||||||
|
:else
|
||||||
(recur (concat ss (-static from to) (-wild to to')) (long (inc to')) (long (inc to')))))
|
(recur (concat ss (-static from to) (-wild to to')) (long (inc to')) (long (inc to')))))
|
||||||
|
|
||||||
(and colon? (= \: c))
|
(and colon? (= \: c) (not= \{ (get s (dec to))))
|
||||||
(let [^long to' (or (str/index-of s "/" to) (count s))]
|
(let [^long to' (or (str/index-of s "/" to) (count s))]
|
||||||
(if (= 1 (- to' to))
|
(if (= 1 (- to' to))
|
||||||
(recur ss from (inc to))
|
(recur ss from (inc to))
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,9 @@
|
||||||
|
|
||||||
"/olipa/:kerran/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
"/olipa/:kerran/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
||||||
"/olipa/{kerran}/avaruus", ["/olipa/{kerran}/avaruus"]
|
"/olipa/{kerran}/avaruus", ["/olipa/{kerran}/avaruus"]
|
||||||
|
"/olipa/{:kerran}/avaruus", ["/olipa/{:kerran}/avaruus"]
|
||||||
"/olipa/{a.b/c}/avaruus", ["/olipa/{a.b/c}/avaruus"]
|
"/olipa/{a.b/c}/avaruus", ["/olipa/{a.b/c}/avaruus"]
|
||||||
|
"/olipa/{:a.b/c}/avaruus", ["/olipa/{:a.b/c}/avaruus"]
|
||||||
"/olipa/kerran/*avaruus", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
"/olipa/kerran/*avaruus", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
||||||
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/{" (trie/->CatchAll (keyword "avaruus}"))]
|
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/{" (trie/->CatchAll (keyword "avaruus}"))]
|
||||||
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/{" (trie/->CatchAll (keyword "valtavan.suuri/avaruus}"))])))
|
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/{" (trie/->CatchAll (keyword "valtavan.suuri/avaruus}"))])))
|
||||||
|
|
@ -53,7 +55,9 @@
|
||||||
|
|
||||||
"/olipa/:kerran/avaruus", ["/olipa/:kerran/avaruus"]
|
"/olipa/:kerran/avaruus", ["/olipa/:kerran/avaruus"]
|
||||||
"/olipa/{kerran}/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
"/olipa/{kerran}/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
||||||
|
"/olipa/{:kerran}/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
||||||
"/olipa/{a.b/c}/avaruus", ["/olipa/" (trie/->Wild :a.b/c) "/avaruus"]
|
"/olipa/{a.b/c}/avaruus", ["/olipa/" (trie/->Wild :a.b/c) "/avaruus"]
|
||||||
|
"/olipa/{:a.b/c}/avaruus", ["/olipa/" (trie/->Wild :a.b/c) "/avaruus"]
|
||||||
"/olipa/kerran/*avaruus", ["/olipa/kerran/*avaruus"]
|
"/olipa/kerran/*avaruus", ["/olipa/kerran/*avaruus"]
|
||||||
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
||||||
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/" (trie/->CatchAll :valtavan.suuri/avaruus)])))
|
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/" (trie/->CatchAll :valtavan.suuri/avaruus)])))
|
||||||
|
|
@ -65,7 +69,9 @@
|
||||||
|
|
||||||
"/olipa/:kerran/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
"/olipa/:kerran/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
||||||
"/olipa/{kerran}/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
"/olipa/{kerran}/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
||||||
|
"/olipa/{:kerran}/avaruus", ["/olipa/" (trie/->Wild :kerran) "/avaruus"]
|
||||||
"/olipa/{a.b/c}/avaruus", ["/olipa/" (trie/->Wild :a.b/c) "/avaruus"]
|
"/olipa/{a.b/c}/avaruus", ["/olipa/" (trie/->Wild :a.b/c) "/avaruus"]
|
||||||
|
"/olipa/{:a.b/c}/avaruus", ["/olipa/" (trie/->Wild :a.b/c) "/avaruus"]
|
||||||
"/olipa/kerran/*avaruus", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
"/olipa/kerran/*avaruus", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
||||||
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/" (trie/->CatchAll :avaruus)]
|
||||||
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/" (trie/->CatchAll :valtavan.suuri/avaruus)])))
|
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/" (trie/->CatchAll :valtavan.suuri/avaruus)])))
|
||||||
|
|
@ -77,7 +83,9 @@
|
||||||
|
|
||||||
"/olipa/:kerran/avaruus", ["/olipa/:kerran/avaruus"]
|
"/olipa/:kerran/avaruus", ["/olipa/:kerran/avaruus"]
|
||||||
"/olipa/{kerran}/avaruus", ["/olipa/{kerran}/avaruus"]
|
"/olipa/{kerran}/avaruus", ["/olipa/{kerran}/avaruus"]
|
||||||
|
"/olipa/{:kerran}/avaruus", ["/olipa/{:kerran}/avaruus"]
|
||||||
"/olipa/{a.b/c}/avaruus", ["/olipa/{a.b/c}/avaruus"]
|
"/olipa/{a.b/c}/avaruus", ["/olipa/{a.b/c}/avaruus"]
|
||||||
|
"/olipa/{:a.b/c}/avaruus", ["/olipa/{:a.b/c}/avaruus"]
|
||||||
"/olipa/kerran/*avaruus", ["/olipa/kerran/*avaruus"]
|
"/olipa/kerran/*avaruus", ["/olipa/kerran/*avaruus"]
|
||||||
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/{*avaruus}"]
|
"/olipa/kerran/{*avaruus}", ["/olipa/kerran/{*avaruus}"]
|
||||||
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/{*valtavan.suuri/avaruus}"]))))
|
"/olipa/kerran/{*valtavan.suuri/avaruus}", ["/olipa/kerran/{*valtavan.suuri/avaruus}"]))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue