|
3 | 3 | " Maintainer: Patrick Walton <[email protected]>
|
4 | 4 | " Maintainer: Ben Blum <[email protected]>
|
5 | 5 | " Maintainer: Chris Morgan <[email protected]>
|
6 |
| -" Last Change: January 29, 2015 |
| 6 | +" Last Change: Feb 24, 2016 |
7 | 7 |
|
8 | 8 | if version < 600
|
9 | 9 | syntax clear
|
@@ -131,7 +131,7 @@ syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustE
|
131 | 131 | syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
132 | 132 | syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
133 | 133 |
|
134 |
| -syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive |
| 134 | +syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError |
135 | 135 | syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
|
136 | 136 | " This list comes from src/libsyntax/ext/deriving/mod.rs
|
137 | 137 | " Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
|
@@ -168,12 +168,15 @@ syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape
|
168 | 168 | syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
169 | 169 |
|
170 | 170 | syn match rustShebang /\%^#![^[].*/
|
171 |
| -syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell |
172 |
| -syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell |
173 |
| -syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell |
174 |
| -syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell |
175 |
| -syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent |
176 |
| -syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent |
| 171 | +syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell |
| 172 | +syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell |
| 173 | +syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained |
| 174 | +syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell |
| 175 | +syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell |
| 176 | +syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained |
| 177 | +syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent |
| 178 | +syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent |
| 179 | +syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent |
177 | 180 | " FIXME: this is a really ugly and not fully correct implementation. Most
|
178 | 181 | " importantly, a case like ``/* */*`` should have the final ``*`` not being in
|
179 | 182 | " a comment, but in practice at present it leaves comments open two levels
|
@@ -236,8 +239,10 @@ hi def link rustFuncCall Function
|
236 | 239 | hi def link rustShebang Comment
|
237 | 240 | hi def link rustCommentLine Comment
|
238 | 241 | hi def link rustCommentLineDoc SpecialComment
|
| 242 | +hi def link rustCommentLineDocError Error |
239 | 243 | hi def link rustCommentBlock rustCommentLine
|
240 | 244 | hi def link rustCommentBlockDoc rustCommentLineDoc
|
| 245 | +hi def link rustCommentBlockDocError Error |
241 | 246 | hi def link rustAssert PreCondit
|
242 | 247 | hi def link rustPanic PreCondit
|
243 | 248 | hi def link rustMacro Macro
|
|
0 commit comments