include more details when error happens importing
This commit is contained in:
@@ -12,9 +12,17 @@
|
||||
\"foo[bar][][baz]\"
|
||||
=> [\"foo\" \"bar\" \"\" \"baz\"]"
|
||||
[param-name]
|
||||
(let [[_ k ks] (re-matches #"(?s)(.*?)((?:\[.*?\])*)" (name param-name))
|
||||
keys (if ks (map second (re-seq #"\[(.*?)\]" ks)))]
|
||||
(cons k keys)))
|
||||
(let [[_ k ks] (re-matches #"(?s)(.*?)((?:(\[.*?\])|\(.*?\))*)" (name param-name))
|
||||
keys (if ks (map second (re-seq #"(\[.*?\]|\(.*?\))" ks)))]
|
||||
(cons k
|
||||
(map (fn [k]
|
||||
(let [[_ indexed-match] (re-matches k "\((.*?)\)")
|
||||
[_ keyed-match] (re-matches k "\[(.*?)\]")]
|
||||
(if indexed-match
|
||||
[:index indexed-match]
|
||||
[:key indexed-match])))))))
|
||||
|
||||
|
||||
|
||||
(defn- assoc-vec [m k v]
|
||||
(let [m (if (contains? m k) m (assoc m k []))]
|
||||
|
||||
Reference in New Issue
Block a user