Skip to content

Commit 848ee49

Browse files
chris-morganalexcrichton
authored andcommitted
---
yaml --- r: 118746 b: refs/heads/snap-stage3 c: b0dff7a h: refs/heads/master v: v3
1 parent 74371f6 commit 848ee49

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: b1646cbfd908dc948b251e362669af421100647a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 31dfcf9dc1e449fbf084485a1dc196695cab680e
4+
refs/heads/snap-stage3: b0dff7a19142b7d52d80ed62a14c1a6cb07cb647
55
refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,11 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
179179

180180
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
181181
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
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
182+
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
183+
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
184+
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
185+
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
186+
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
184187

185188
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
186189
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
@@ -223,6 +226,8 @@ hi def link rustEscapeUnicode rustEscape
223226
hi def link rustEscapeError Error
224227
hi def link rustStringContinuation Special
225228
hi def link rustString String
229+
hi def link rustCharacterInvalid Error
230+
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
226231
hi def link rustCharacter Character
227232
hi def link rustNumber Number
228233
hi def link rustBoolean Boolean

0 commit comments

Comments
 (0)