@@ -145,11 +145,13 @@ syn match rustOperator display "&&\|||"
145
145
syn match rustMacro ' \w\(\w\) *!' contains =rustAssert,rustFail
146
146
syn match rustMacro ' #\w\(\w\) *' contains =rustAssert,rustFail
147
147
148
- syn match rustSpecialError display contained / \\ ./
149
- syn match rustSpecial display contained / \\\( [nrt0\\ '"]\| x\x\{ 2}\| u\x\{ 4}\| U\x\{ 8}\) /
148
+ syn match rustEscapeError display contained / \\ ./
149
+ syn match rustEscape display contained / \\\( [nrt0\\ '"]\| x\x\{ 2}\) /
150
+ syn match rustEscapeUnicode display contained / \\\( u\x\{ 4}\| U\x\{ 8}\) /
150
151
syn match rustStringContinuation display contained / \\\n\s */
151
- syn region rustString start =+ "+ skip =+ \\\\\|\\ "+ end =+ "+ contains =rustSpecial,rustSpecialError,rustStringContinuation,@Spell
152
- syn region rustString start =' r\z (#*\) "' end =' "\z 1' contains =@Spell
152
+ syn region rustString start =+ b"+ skip =+ \\\\\|\\ "+ end =+ "+ contains =rustEscape,rustEscapeError,rustStringContinuation
153
+ syn region rustString start =+ "+ skip =+ \\\\\|\\ "+ end =+ "+ contains =rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
154
+ syn region rustString start =' b\? r\z (#*\) "' end =' "\z 1' contains =@Spell
153
155
154
156
syn region rustAttribute start =" #!\?\[ " end =" \] " contains =rustString,rustDeriving
155
157
syn region rustDeriving start =" deriving(" end =" )" contained contains =rustTrait
@@ -177,7 +179,8 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
177
179
178
180
" rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
179
181
syn match rustLifetime display " \'\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *"
180
- syn match rustCharacter / '\( [^'\\ ]\|\\\( .\| x\x\{ 2}\| u\x\{ 4}\| U\x\{ 8}\)\) '/ contains =rustSpecial,rustSpecialError
182
+ syn match rustCharacter / b'\( [^'\\ ]\|\\\( .\| x\x\{ 2}\)\) '/ contains =rustEscape,rustEscapeError
183
+ syn match rustCharacter / '\( [^'\\ ]\|\\\( .\| x\x\{ 2}\| u\x\{ 4}\| U\x\{ 8}\)\) '/ contains =rustEscape,rustEscapeUnicode,rustEscapeError
181
184
182
185
syn region rustCommentLine start =" //" end =" $" contains =rustTodo,@Spell
183
186
syn region rustCommentLineDoc start =" //\% (//\@ !\| !\) " end =" $" contains =rustTodo,@Spell
@@ -215,8 +218,9 @@ hi def link rustIdentifierPrime rustIdentifier
215
218
hi def link rustTrait rustType
216
219
217
220
hi def link rustSigil StorageClass
218
- hi def link rustSpecial Special
219
- hi def link rustSpecialError Error
221
+ hi def link rustEscape Special
222
+ hi def link rustEscapeUnicode rustEscape
223
+ hi def link rustEscapeError Error
220
224
hi def link rustStringContinuation Special
221
225
hi def link rustString String
222
226
hi def link rustCharacter Character
0 commit comments