Skip to content
Prev Previous commit
Next Next commit
Limit negative lookbehind in clojureKeyword
  • Loading branch information
guns committed Feb 12, 2017
commit 4ed031c038712cb70c6d9f11ccad438000854623
40 changes: 19 additions & 21 deletions clj/test/vim_clojure_static/syntax_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,25 @@

(comment (test #'test-character-literals))

;; TODO: Finish me! (this was in an old git stash)
;; (defsyntaxtest keywords-test
;; (with-format "%s"
;; ":1" kw
;; ":A" kw
;; ":a" kw
;; ":αβγ" kw
;; "::a" kw
;; ":a/b" kw
;; ":a:b" kw
;; ":a:b/:c:b" kw
;; ":a/b/c/d" kw
;; "::a/b" !kw
;; "::" !kw
;; ":a:" !kw
;; ":a/" !kw
;; ":/" !kw
;; ":" !kw
;; ))
;;
;; (comment (test #'keywords-test))
(defsyntaxtest keywords-test
["%s"
[":1" kw
":A" kw
":a" kw
":αβγ" kw
"::a" kw
":a/b" kw
":a:b" kw
":a:b/:c:b" kw
":a/b/c/d" kw
"::a/b" kw
"::" !kw
":a:" !kw
":a/" !kw
; ":/" !kw ; This is legal, but for simplicity we do not match it
":" !kw]])

(comment (test #'keywords-test))

(defsyntaxtest test-java-regexp-literals
["#\"%s\""
Expand Down
2 changes: 1 addition & 1 deletion syntax/clojure.vim
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ delfunction s:syntax_keyword
" * Must not end in a : or /
" * Must not have two adjacent colons except at the beginning
" * Must not contain any reader metacharacters except for ' and #
syntax match clojureKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\t()\[\]{}";@^`~\\%/]+:@<!>"
syntax match clojureKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\t()\[\]{}";@^`~\\%/]+:@1<!>"

syntax match clojureStringEscape "\v\\%([\\btnfr"]|u\x{4}|[0-3]\o{2}|\o{1,2})" contained

Expand Down