File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1+ {:lint-as {vim-clojure-static.test/with-tempfile clojure.core/fn
2+ vim-clojure-static.test/defpredicates clojure.core/def
3+ vim-clojure-static.test/defsyntaxtest clojure.core/def
4+ }}
Original file line number Diff line number Diff line change 332332 " Vimscript literal `setlocal lispwords=` statement."
333333 (str " setlocal lispwords=" (string/join \, (sort lispwords)) " \n " ))
334334
335- (defn- comprehensive-clojure-character-property-regexps []
335+ (defn- comprehensive-clojure-character-property-regexps
336336 " A string representing a Clojure literal vector of regular expressions
337337 containing all possible property character classes. For testing Vimscript
338338 syntax matching optimizations."
339+ []
339340 (let [fmt (fn [prefix prop-key]
340341 (let [props (map (partial format " \\ p{%s%s}" prefix)
341342 (sort (get character-properties prop-key)))]
456457 (spit " tmp/all-char-props.clj"
457458 (comprehensive-clojure-character-property-regexps ))
458459
460+ (require 'vim-clojure-static.test)
461+
459462 ; ; Performance test: `syntax keyword` vs `syntax match`
460463 (vim-clojure-static.test/benchmark
461464 1000 " tmp/bench.clj" (str keyword-groups)
Original file line number Diff line number Diff line change 1111
1212(defmacro with-tempfile
1313 {:requires [File]}
14- [tmp-sym & body]
14+ [[ tmp-sym] & body]
1515 `(let [~tmp-sym (File/createTempFile " vim-clojure-static" " .tmp" )]
1616 (try
1717 ~@body
2323 value of vim-expr is evaluated as EDN and returned."
2424 [file buf vim-expr & opts]
2525 (let [{:keys [pre]} (apply hash-map opts)]
26- (with-tempfile tmp
26+ (with-tempfile [ tmp]
2727 (io/make-parents file)
2828 (spit file buf)
2929 (spit tmp (str " let @x = " vim-expr))
121121
122122 `in` and `out` are urls that will be passed to clojure.java.io/resource."
123123 {:requires [#'test/testing #'with-tempfile]}
124- [string {:keys [in out]} [tmp-sym] & body]
124+ [string {:keys [in out]} [tmp-sym :as tmp-binding ] & body]
125125 `(test/testing ~string
126- (with-tempfile ~tmp-sym
126+ (with-tempfile ~tmp-binding
127127 (try
128128 (spit ~tmp-sym (slurp (~io/resource ~in)))
129129 ~@body
Original file line number Diff line number Diff line change 44(ns vim-clojure-static.syntax-test
55 (:require [vim-clojure-static.test :refer [defpredicates defsyntaxtest ]]))
66
7+ ; ; defpredicates also register not-equal vars, this is just for clj-kondo
8+ (declare !number !regexp-escape !regexp-posix-char-class !regexp-quantifier )
9+
710(defpredicates number :clojureNumber )
811(defpredicates kw :clojureKeyword )
912(defpredicates regexp :clojureRegexp )
You can’t perform that action at this time.
0 commit comments