File tree 4 files changed +15
-5
lines changed
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 332
332
" Vimscript literal `setlocal lispwords=` statement."
333
333
(str " setlocal lispwords=" (string/join \, (sort lispwords)) " \n " ))
334
334
335
- (defn- comprehensive-clojure-character-property-regexps []
335
+ (defn- comprehensive-clojure-character-property-regexps
336
336
" A string representing a Clojure literal vector of regular expressions
337
337
containing all possible property character classes. For testing Vimscript
338
338
syntax matching optimizations."
339
+ []
339
340
(let [fmt (fn [prefix prop-key]
340
341
(let [props (map (partial format " \\ p{%s%s}" prefix)
341
342
(sort (get character-properties prop-key)))]
456
457
(spit " tmp/all-char-props.clj"
457
458
(comprehensive-clojure-character-property-regexps ))
458
459
460
+ (require 'vim-clojure-static.test)
461
+
459
462
; ; Performance test: `syntax keyword` vs `syntax match`
460
463
(vim-clojure-static.test/benchmark
461
464
1000 " tmp/bench.clj" (str keyword-groups)
Original file line number Diff line number Diff line change 11
11
12
12
(defmacro with-tempfile
13
13
{:requires [File]}
14
- [tmp-sym & body]
14
+ [[ tmp-sym] & body]
15
15
`(let [~tmp-sym (File/createTempFile " vim-clojure-static" " .tmp" )]
16
16
(try
17
17
~@body
23
23
value of vim-expr is evaluated as EDN and returned."
24
24
[file buf vim-expr & opts]
25
25
(let [{:keys [pre]} (apply hash-map opts)]
26
- (with-tempfile tmp
26
+ (with-tempfile [ tmp]
27
27
(io/make-parents file)
28
28
(spit file buf)
29
29
(spit tmp (str " let @x = " vim-expr))
121
121
122
122
`in` and `out` are urls that will be passed to clojure.java.io/resource."
123
123
{:requires [#'test/testing #'with-tempfile]}
124
- [string {:keys [in out]} [tmp-sym] & body]
124
+ [string {:keys [in out]} [tmp-sym :as tmp-binding ] & body]
125
125
`(test/testing ~string
126
- (with-tempfile ~tmp-sym
126
+ (with-tempfile ~tmp-binding
127
127
(try
128
128
(spit ~tmp-sym (slurp (~io/resource ~in)))
129
129
~@body
Original file line number Diff line number Diff line change 4
4
(ns vim-clojure-static.syntax-test
5
5
(:require [vim-clojure-static.test :refer [defpredicates defsyntaxtest ]]))
6
6
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
+
7
10
(defpredicates number :clojureNumber )
8
11
(defpredicates kw :clojureKeyword )
9
12
(defpredicates regexp :clojureRegexp )
You can’t perform that action at this time.
0 commit comments