aboutsummaryrefslogtreecommitdiff
path: root/src/etc/rust.vim
blob: 2a5a58b90427cdd4fb67ace7eb294b6faba2c02b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
" Vim syntax file
" Language:     Rust
" Maintainer:   Patrick Walton <[email protected]>
" Last Change:  2010 Oct 13

" Quit when a syntax file was already loaded
if !exists("main_syntax")
  if version < 600
    syntax clear
  elseif exists("b:current_syntax")
    finish
  endif
  " we define it here so that included files can test for it
  let main_syntax='rust'
endif

syn keyword   rustKeyword     use meta syntax mutable native mod import export
syn keyword   rustKeyword     let auto io state unsafe auth with bind type true
syn keyword   rustKeyword     false any int uint float char bool u8 u16 u32 u64
syn keyword   rustKeyword     f32 i8 i16 i32 i64 f64 rec tup tag vec str fn
syn keyword   rustKeyword     iter obj as drop task port chan flush spawn if
syn keyword   rustKeyword     else alt case in do while break cont fail log
syn keyword   rustKeyword     note claim check prove for each ret put be

syn region	  rustString		  start=+L\="+ skip=+\\\\\|\\"+ end=+"+

syn region    rustComment     start="/\*" end="\*/"
syn region    rustComment     start="//" skip="\\$" end="$" keepend

hi def link rustString        String
hi def link rustKeyword       Keyword
hi def link rustComment       Comment

let b:current_syntax = "rust"