Skip to content

Commit 0d334ac

Browse files
committed
---
yaml --- r: 2493 b: refs/heads/master c: 295c037 h: refs/heads/master i: 2491: 51c393c v: v3
1 parent a2b6ca5 commit 0d334ac

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 1fdddede227031b4ea1df98da7eb3e2fcc8c7d87
2+
refs/heads/master: 295c037aac7b48a3d00593b21f00d7ff07127985

trunk/src/etc/rust.vim

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,49 @@ if !exists("main_syntax")
1515
endif
1616

1717
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
2423

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
2626

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
2749
syn region rustComment start="/\*" end="\*/"
2850
syn region rustComment start="//" skip="\\$" end="$" keepend
2951

3052
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
3157
hi def link rustKeyword Keyword
3258
hi def link rustComment Comment
59+
hi def link rustMacro Macro
60+
hi def link rustType Type
3361

3462
let b:current_syntax = "rust"
3563

0 commit comments

Comments
 (0)