Skip to content

Commit e8bd74f

Browse files
nopromptguns
authored andcommitted
Add new syntax match group "clojureStringEscape"
Allow for highlighting of escape characters contained within clojureString. Also, update clojureCharacter to support all unicode values.
1 parent abb7fa0 commit e8bd74f

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

syntax/clojure.vim

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ syntax keyword clojureVariable *1 *2 *3 *agent* *allow-unresolved-vars* *assert*
3434
" * Must not contain any reader metacharacters except for ' and #
3535
syntax match clojureKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\t()\[\]{}";@^`~\\%/]+:@<!>"
3636

37-
syntax region clojureString start=/L\="/ skip=/\\\\\|\\"/ end=/"/
37+
syntax match clojureStringEscape "\\\\\|\\[btnfr"]\|\\u[0-9a-fA-F]\{4\}" contained
38+
39+
syntax region clojureString start=/L\="/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape
3840

3941
syntax match clojureCharacter "\\."
4042
syntax match clojureCharacter "\\o\o\{3\}"
43+
syntax match clojureCharacter "\\u[0-9a-fA-F]\{4\}"
4144
syntax match clojureCharacter "\\u\d\{4\}"
4245
syntax match clojureCharacter "\\space"
4346
syntax match clojureCharacter "\\tab"
@@ -88,13 +91,14 @@ syntax match clojureError "]\|}\|)"
8891

8992
syntax sync fromstart
9093

91-
highlight default link clojureConstant Constant
92-
highlight default link clojureBoolean Boolean
93-
highlight default link clojureCharacter Character
94-
highlight default link clojureKeyword Keyword
95-
highlight default link clojureNumber Number
96-
highlight default link clojureString String
97-
highlight default link clojureRegexp Constant
94+
highlight default link clojureConstant Constant
95+
highlight default link clojureBoolean Boolean
96+
highlight default link clojureCharacter Character
97+
highlight default link clojureKeyword Keyword
98+
highlight default link clojureNumber Number
99+
highlight default link clojureString String
100+
highlight default link clojureStringEscape Character
101+
highlight default link clojureRegexp Constant
98102

99103
highlight default link clojureVariable Identifier
100104
highlight default link clojureCond Conditional

0 commit comments

Comments
 (0)