Skip to content

Commit f7daa85

Browse files
committed
Improve clojure pairwise queries
1 parent fee6321 commit f7daa85

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

queries/clojure/paredit/pairs.scm

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
11
(list_lit
22
(sym_lit) @fn-name
3+
(#any-of? @fn-name
4+
"let"
5+
"loop"
6+
"binding"
7+
"with-open"
8+
"with-redefs")
9+
310
(vec_lit
4-
(_) @pair)
5-
(#any-of? @fn-name "let" "loop" "binding" "with-open" "with-redefs"))
11+
(_) @pair))
612

713
(map_lit
814
(_) @pair)
915

1016
(list_lit
1117
(sym_lit) @fn-name
12-
(_)
13-
(_) @pair
14-
(#eq? @fn-name "case"))
18+
(#eq? @fn-name "case")
19+
20+
(_) .
21+
((_) @pair . (_) @pair)+
22+
(_)?)
1523

1624
(list_lit
1725
(sym_lit) @fn-name
18-
(_) @pair
19-
(#eq? @fn-name "cond"))
26+
(#eq? @fn-name "cond")
2027

21-
(list_lit
28+
((_) @pair (_) @pair)+)
29+
30+
(list_lit
2231
(sym_lit) @fn-name
32+
(#any-of? @fn-name
33+
"cond->"
34+
"cond->>")
2335
(_)
24-
(_)
25-
(_) @pair
26-
(#eq? @fn-name "condp"))
36+
.
37+
((_) @pair . (_) @pair)+)
38+
39+
(list_lit
40+
(sym_lit) @fn-name
41+
(#eq? @fn-name "condp")
42+
43+
(_) (_)
44+
.
45+
((_) @pair . (_) @pair)+
46+
.
47+
(_)?)

0 commit comments

Comments
 (0)