@@ -68,40 +68,23 @@ delfunction s:syntax_keyword
68
68
" * Must not end in a : or /
69
69
" * Must not have two adjacent colons except at the beginning
70
70
" * Must not contain any reader metacharacters except for ' and #
71
- syntax match clojureKeyword " \v <:{1,2}%([^ \n\r\t ()\[\] {}";@^`~\\ %/]+/)*[^ \n\r\t ()\[\] {}";@^`~\\ %/]+:@<!>"
71
+ syntax match clojureKeyword " \v <:{1,2}%([^ \n\r\t ()\[\] {}";@^`~\\ %/]+/)*[^ \n\r\t ()\[\] {}";@^`~\\ %/]+:@1 <!>"
72
72
73
73
syntax match clojureStringEscape " \v\\ %([\\ btnfr"]|u\x {4}|[0-3]\o {2}|\o {1,2})" contained
74
74
75
75
syntax region clojureString matchgroup =clojureStringDelimiter start =/ "/ skip =/ \\\\\|\\ "/ end =/ "/ contains =clojureStringEscape,@Spell
76
76
77
- syntax match clojureCharacter " \\ ."
78
- syntax match clojureCharacter " \\ o\% ([0-3]\o\{ 2\}\|\o\{ 1,2\}\) "
79
- syntax match clojureCharacter " \\ u\x\{ 4\} "
80
- syntax match clojureCharacter " \\ space"
81
- syntax match clojureCharacter " \\ tab"
82
- syntax match clojureCharacter " \\ newline"
83
- syntax match clojureCharacter " \\ return"
84
- syntax match clojureCharacter " \\ backspace"
85
- syntax match clojureCharacter " \\ formfeed"
77
+ syntax match clojureCharacter " \v\\ %(o%([0-3]\o {2}|\o {1,2})|u\x {4}|newline|tab|space|return|backspace|formfeed|.)"
86
78
87
- syntax match clojureSymbol " \v %([a-zA-Z!$&*_+=|<.>?-]|[^\x 00-\x 7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x 00-\x 7F]))*[#:]@<!"
79
+ syntax match clojureSymbol " \v %([a-zA-Z!$&*_+=|<.>?-]|[^\x 00-\x 7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x 00-\x 7F]))*[#:]@1 <!"
88
80
89
- let s: radix_chars = " 0123456789abcdefghijklmnopqrstuvwxyz"
90
- for s: radix in range (2 , 36 )
91
- execute ' syntax match clojureNumber "\v\c<[-+]?' . s: radix . ' r[' . strpart (s: radix_chars , 0 , s: radix ) . ' ]+>"'
92
- endfor
93
- unlet ! s: radix_chars s: radix
94
-
95
- syntax match clojureNumber " \v <[-+]?%(0\o *|0x\x +|[1-9]\d *)N?>"
96
- syntax match clojureNumber " \v <[-+]?%(0|[1-9]\d *|%(0|[1-9]\d *)\.\d *)%(M|[eE][-+]?\d +)?>"
97
- syntax match clojureNumber " \v <[-+]?%(0|[1-9]\d *)/%(0|[1-9]\d *)>"
81
+ " NB. Correct matching of radix literals was removed for better performance.
82
+ syntax match clojureNumber " \v <[-+]?%(%([2-9]|[12]\d |3[0-6])[rR][[:alnum:]]+|%(0\o *|0x\x +|[1-9]\d *)N?|%(0|[1-9]\d *|%(0|[1-9]\d *)\.\d *)%(M|[eE][-+]?\d +)?|%(0|[1-9]\d *)/%(0|[1-9]\d *))>"
98
83
99
84
syntax match clojureVarArg " &"
100
85
101
- syntax match clojureQuote " '"
102
- syntax match clojureQuote " `"
103
- syntax match clojureUnquote " \~ "
104
- syntax match clojureUnquote " \~ @"
86
+ syntax match clojureQuote " \v ['`]"
87
+ syntax match clojureUnquote " \v\~\@ ?"
105
88
syntax match clojureMeta " \^ "
106
89
syntax match clojureDeref " @"
107
90
syntax match clojureDispatch " \v #[\^ '=<_]?"
@@ -134,14 +117,14 @@ syntax match clojureRegexpBoundary "[$^]" contained display
134
117
syntax match clojureRegexpQuantifier " [?*+][?+]\= " contained display
135
118
syntax match clojureRegexpQuantifier " \v\{\d +%(,|,\d +)?}\? ?" contained display
136
119
syntax match clojureRegexpOr " |" contained display
137
- syntax match clojureRegexpBackRef " \v\\ %([1-9]\d *|k\< [a-zA-z ]+\> )" contained display
120
+ syntax match clojureRegexpBackRef " \v\\ %([1-9]\d *|k\< [[:alpha:] ]+\> )" contained display
138
121
139
122
" Mode modifiers, mode-modified spans, lookaround, regular and atomic
140
123
" grouping, and named-capturing.
141
124
syntax match clojureRegexpMod " \v\( @<=\? :" contained display
142
125
syntax match clojureRegexpMod " \v\( @<=\? [xdsmiuU]*-?[xdsmiuU]+:?" contained display
143
126
syntax match clojureRegexpMod " \v\( @<=\? %(\< ?[=!]|\> )" contained display
144
- syntax match clojureRegexpMod " \v\( @<=\?\< [a-zA-Z ]+\> " contained display
127
+ syntax match clojureRegexpMod " \v\( @<=\?\< [[:alpha:] ]+\> " contained display
145
128
146
129
syntax region clojureRegexpGroup start =" (" skip =/ \\\\\|\\ )/ end =" )" matchgroup =clojureRegexpGroup contained contains =clojureRegexpMod,clojureRegexpQuantifier,clojureRegexpBoundary,clojureRegexpEscape,@clojureRegexpCharClasses
147
130
syntax region clojureRegexp start =/ \# "/ skip =/ \\\\\|\\ "/ end =/ "/ contains =@clojureRegexpCharClasses,clojureRegexpEscape,clojureRegexpQuote,clojureRegexpBoundary,clojureRegexpQuantifier,clojureRegexpOr,clojureRegexpBackRef,clojureRegexpGroup keepend
0 commit comments