@@ -15,21 +15,49 @@ if !exists("main_syntax")
15
15
endif
16
16
17
17
syn keyword rustKeyword use meta syntax mutable native mod import export
18
- syn keyword rustKeyword let auto io state unsafe auth with bind type true
19
- syn keyword rustKeyword false any int uint float char bool u8 u16 u32 u64
20
- syn keyword rustKeyword f32 i8 i16 i32 i64 f64 rec tup tag vec str fn
21
- syn keyword rustKeyword iter obj as drop task port chan flush spawn if
22
- syn keyword rustKeyword else alt case in do while break cont fail log
23
- syn keyword rustKeyword note claim check prove for each ret put be
18
+ syn keyword rustKeyword let auto io state unsafe auth with bind type rec
19
+ syn keyword rustKeyword tup tag vec fn iter obj as drop task chan flush
20
+ syn keyword rustKeyword spawn if else alt case in do while break cont
21
+ syn keyword rustKeyword fail log log_err note claim check prove assert
22
+ syn keyword rustKeyword for each ret put be
24
23
25
- syn region rustString start =+ L\= "+ skip =+ \\\\\|\\ "+ end =+ "+
24
+ syn keyword rustType any int uint float char bool u8 u16 u32 u64 f32
25
+ syn keyword rustType f64 i8 i16 i32 i64 str task
26
26
27
+ syn keyword rustBoolean true false
28
+
29
+ syn match rustItemPath " \(\w\| ::\)\+ "
30
+
31
+ syn region rustString start =+ L\= "+ skip =+ \\\\\|\\ "+ end =+ "+
32
+
33
+ " integer number, or floating point number without a dot and with "f".
34
+ syn case ignore
35
+ syn match rustNumber display contained " \d\+\( u\= l\{ 0,2}\| ll\= u\)\> "
36
+ " hex number
37
+ syn match rustNumber display contained " 0x\x\+\( u\= l\{ 0,2}\| ll\= u\)\> "
38
+ syn match rustFloat display contained " \d\+ f"
39
+ " floating point number, with dot, optional exponent
40
+ syn match rustFloat display contained " \d\+\.\d *\( e[-+]\=\d\+\)\= [fl]\= "
41
+ " floating point number, starting with a dot, optional exponent
42
+ syn match rustFloat display contained " \.\d\+\( e[-+]\=\d\+\)\= [fl]\=\> "
43
+ " floating point number, without dot, with exponent
44
+ syn match rustFloat display contained " \d\+ e[-+]\=\d\+ [fl]\=\> "
45
+
46
+ syn match rustCharacter " '[^']*'"
47
+
48
+ syn case match
27
49
syn region rustComment start =" /\* " end =" \* /"
28
50
syn region rustComment start =" //" skip =" \\ $" end =" $" keepend
29
51
30
52
hi def link rustString String
53
+ hi def link rustCharacter Character
54
+ hi def link rustNumber Number
55
+ hi def link rustBoolean Boolean
56
+ hi def link rustFloat Float
31
57
hi def link rustKeyword Keyword
32
58
hi def link rustComment Comment
59
+ hi def link rustMacro Macro
60
+ hi def link rustType Type
33
61
34
62
let b: current_syntax = " rust"
35
63
0 commit comments