Skip to content

Commit

Permalink
auto merge of rust-lang#5760 : klutzy/rust/vim, r=thestinger
Browse files Browse the repository at this point in the history
1. disable nested comment which is not supported now
2. add syntax highlight for rustCommentDoc e.g. `/** doc */` or `/// doc`.
  • Loading branch information
bors committed Apr 8, 2013
2 parents 5641777 + fc26911 commit 2255587
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/etc/vim/syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"

syn region rustComment start="/\*" end="\*/" contains=rustComment,rustTodo
syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend
syn region rustCommentDoc start="/\*\*" end="\*/"
syn region rustCommentDoc start="///" skip="\\$" end="$" keepend
syn match rustComment "/\*\*/"
syn region rustComment start="/\*\([^\*]\|$\)" end="\*/" contains=rustTodo
syn region rustComment start="//\([^/]\|$\)" skip="\\$" end="$" contains=rustTodo keepend

syn keyword rustTodo contained TODO FIXME XXX NB

Expand All @@ -134,6 +137,7 @@ hi def link rustConditional Conditional
hi def link rustIdentifier Identifier
hi def link rustModPath Include
hi def link rustFuncName Function
hi def link rustCommentDoc SpecialComment
hi def link rustComment Comment
hi def link rustMacro Macro
hi def link rustType Type
Expand Down

0 comments on commit 2255587

Please sign in to comment.