@@ -10,14 +10,13 @@ elseif exists("b:current_syntax")
10
10
finish
11
11
endif
12
12
13
- syn keyword rustAssert assert
14
- syn match rustAssert " assert\(\w\) *"
15
- syn keyword rustKeyword alt again as break
16
- syn keyword rustKeyword check claim const copy do drop else export extern fail
13
+ syn match rustAssert " \< assert\(\w\) *"
14
+ syn keyword rustKeyword again as break
15
+ syn keyword rustKeyword const copy do drop else export extern fail
17
16
syn keyword rustKeyword for if impl import in let log
18
17
syn keyword rustKeyword loop match mod module move mut new of owned priv pub pure
19
- syn keyword rustKeyword ref ret return static to unchecked
20
- syn match rustKeyword " unsafe" " Allows also matching unsafe::foo()
18
+ syn keyword rustKeyword ref return static to unchecked
19
+ syn match rustKeyword " \< unsafe\> " " Allows also matching unsafe::foo()
21
20
syn keyword rustKeyword use while with
22
21
" FIXME: Scoped impl's name is also fallen in this category
23
22
syn keyword rustKeyword mod trait class struct enum type nextgroup =rustIdentifier skipwhite
@@ -73,7 +72,9 @@ syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 contains=rustAssert "
73
72
syn match rustMacro ' \w\(\w\) *!'
74
73
syn match rustMacro ' #\w\(\w\) *'
75
74
76
- syn region rustString start =+ L\= "+ skip =+ \\\\\|\\ "+ end =+ "+ contains =rustTodo
75
+ syn match rustFormat display " %\(\d\+\$\)\= [-+' #0*]*\(\d *\|\*\|\*\d\+\$\)\(\.\(\d *\|\*\|\*\d\+\$\)\)\=\( [hlLjzt]\| ll\| hh\)\=\( [aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\= .[^]]*\]\) " contained
76
+ syn match rustFormat display " %%" contained
77
+ syn region rustString start =+ L\= "+ skip =+ \\\\\|\\ "+ end =+ "+ contains =rustTodo,rustFormat
77
78
78
79
syn region rustAttribute start =" #\[ " end =" \] " contains =rustString
79
80
@@ -108,6 +109,7 @@ hi def link rustHexNumber rustNumber
108
109
hi def link rustBinNumber rustNumber
109
110
hi def link rustIdentifierPrime rustIdentifier
110
111
112
+ hi def link rustFormat Special
111
113
hi def link rustString String
112
114
hi def link rustCharacter Character
113
115
hi def link rustNumber Number
0 commit comments