Skip to content

Commit

Permalink
DEV: Treat uneval nodes as comments in ns sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
or committed Jul 2, 2022
1 parent c686ae5 commit 008f5ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cljfmt/src/cljfmt/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@
:end end})))

(defn- find-elements-with-comments [nodes]
(re-seq-matcher #"(CNS*)*E(S*C)?"
(re-seq-matcher #"(CNS*)*E(S*C)*"
#(case (n/tag %)
(:whitespace :comma) \S
:comment \C
(:comment :uneval) \C
:newline \N
\E)
nodes))
Expand Down Expand Up @@ -467,7 +467,7 @@


(defn- node-sort-string [nodes]
(-> (remove (some-fn n/comment? n/whitespace?) nodes)
(-> (remove (some-fn n/comment? n/whitespace? #(-> % n/tag (= :uneval))) nodes)
(nodes-string)
(str/replace #"[\[\]\(\)\{\}]|\^[:\w-]+" "")
(str/trim)))
Expand Down

0 comments on commit 008f5ab

Please sign in to comment.