Skip to content

Commit 4811838

Browse files
chris-morganalexcrichton
authored andcommitted
---
yaml --- r: 118679 b: refs/heads/try c: 31dfcf9 h: refs/heads/master i: 118677: d09ec23 118675: a6c9880 118671: 2bb217b v: v3
1 parent de3a9c8 commit 4811838

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b1646cbfd908dc948b251e362669af421100647a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d6736a1440d42f6af967a8a20ab8d73522112b72
5-
refs/heads/try: 90f7e3a644c9795d9a7dce87d8c6b0cf369a7503
5+
refs/heads/try: 31dfcf9dc1e449fbf084485a1dc196695cab680e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ syn match rustOperator display "&&\|||"
145145
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
146146
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
147147

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}\)/
150151
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='"\z1' 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='"\z1' contains=@Spell
153155

154156
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
155157
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
@@ -177,7 +179,8 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
177179

178180
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
179181
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
181184

182185
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
183186
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
@@ -215,8 +218,9 @@ hi def link rustIdentifierPrime rustIdentifier
215218
hi def link rustTrait rustType
216219

217220
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
220224
hi def link rustStringContinuation Special
221225
hi def link rustString String
222226
hi def link rustCharacter Character

0 commit comments

Comments
 (0)