|
103 | 103 | monitor-enter monitor-exit . new set!})
|
104 | 104 |
|
105 | 105 | (def keyword-groups
|
106 |
| - "Special forms, constants, and every public var in clojure.core listed by |
107 |
| - syntax group suffix." |
108 |
| - (let [builtins [["clojureConstant" '#{nil}] |
109 |
| - ["clojureBoolean" '#{true false}] |
110 |
| - ["clojureSpecial" special-forms] |
| 106 | + "Special forms, constants, and every public var in clojure.core keyed by |
| 107 | + syntax group name." |
| 108 | + (let [builtins {"clojureConstant" '#{nil} |
| 109 | + "clojureBoolean" '#{true false} |
| 110 | + "clojureSpecial" special-forms |
111 | 111 | ;; These are duplicates from special-forms
|
112 |
| - ["clojureException" '#{throw try catch finally}] |
113 |
| - ["clojureCond" '#{case cond cond-> cond->> condp if-let |
114 |
| - if-not if-some when when-first when-let |
115 |
| - when-not when-some}] |
| 112 | + "clojureException" '#{throw try catch finally} |
| 113 | + "clojureCond" '#{case cond cond-> cond->> condp if-let |
| 114 | + if-not if-some when when-first when-let |
| 115 | + when-not when-some} |
116 | 116 | ;; Imperative looping constructs (not sequence functions)
|
117 |
| - ["clojureRepeat" '#{doseq dotimes while}]] |
| 117 | + "clojureRepeat" '#{doseq dotimes while}} |
118 | 118 | coresyms (set/difference (set (keys (ns-publics 'clojure.core)))
|
119 | 119 | (set (mapcat peek builtins)))
|
120 | 120 | group-preds [["clojureDefine" #(re-seq #"\Adef(?!ault)" (str %))]
|
|
123 | 123 | ["clojureVariable" identity]]]
|
124 | 124 | (first
|
125 | 125 | (reduce
|
126 |
| - (fn [[v syms] [group pred]] |
| 126 | + (fn [[m syms] [group pred]] |
127 | 127 | (let [group-syms (set (filterv pred syms))]
|
128 |
| - [(conj v [group group-syms]) |
| 128 | + [(assoc m group group-syms) |
129 | 129 | (set/difference syms group-syms)]))
|
130 | 130 | [builtins coresyms] group-preds))))
|
131 | 131 |
|
|
134 | 134 | (let [props (->> (get-private-field Pattern$CharPropertyNames "map")
|
135 | 135 | (mapv (fn [[prop field]] [(inner-class-name (class field)) prop]))
|
136 | 136 | (group-by first)
|
137 |
| - (reduce (fn [m [k v]] (assoc m k (mapv peek v))) {})) |
| 137 | + (reduce-kv (fn [m k v] (assoc m k (mapv peek v))) {})) |
138 | 138 | binary (concat (map #(.name ^UnicodeProp %) (get-private-field UnicodeProp "$VALUES"))
|
139 | 139 | (keys (get-private-field UnicodeProp "aliases")))
|
140 | 140 | script (concat (map #(.name ^Character$UnicodeScript %) (Character$UnicodeScript/values))
|
|
183 | 183 | (def vim-keywords
|
184 | 184 | "Vimscript literal dictionary of important identifiers."
|
185 | 185 | (->> keyword-groups
|
| 186 | + sort |
186 | 187 | (map (fn [[group keywords]]
|
187 | 188 | (->> keywords
|
188 | 189 | map-keyword-names
|
|
344 | 345 | vim-unicode-block-char-classes)
|
345 | 346 | "-*- TOP CLUSTER -*-"
|
346 | 347 | (qstr generation-comment
|
347 |
| - (vim-top-cluster (mapv first keyword-groups) |
| 348 | + (vim-top-cluster (keys keyword-groups) |
348 | 349 | (slurp (fjoin dir "syntax/clojure.vim"))))}
|
349 | 350 |
|
350 | 351 | (fjoin dir "ftplugin/clojure.vim")
|
|
0 commit comments