-
-
Notifications
You must be signed in to change notification settings - Fork 290
/
babashka.clj
21 lines (20 loc) · 871 Bytes
/
babashka.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(ns clj-kondo.impl.analyzer.babashka
{:no-doc true}
(:require
[clj-kondo.impl.analyzer.common :as common]
[clj-kondo.impl.utils :as utils]))
(defn analyze-$ [ctx expr]
(let [[child & children] (rest (:children expr))
[opts children] (if (= :map (utils/tag child))
[child children]
[nil (cons child children)])
children (doall (keep (fn [child]
(let [s (utils/sexpr child)]
(when (and (seq? s)
(= 'clojure.core/unquote (first s)))
(first (:children child)))))
children))
children (if opts
(cons opts children)
children)]
(common/analyze-children ctx children)))