@@ -230,6 +230,27 @@ syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError star
230
230
231
231
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
232
232
233
+ " asm! macro {{{2
234
+ syn region rustAsmMacro matchgroup =rustMacro start =" \< asm!\s *(" end =" )" contains =rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*
235
+
236
+ " Clobbered registers
237
+ syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup =rustAsmReg skipwhite skipempty
238
+ syn region rustAsmReg start =" (" end =" )" contained contains =rustString
239
+
240
+ " Symbol operands
241
+ syn keyword rustAsmSym sym contained nextgroup =rustAsmSymPath skipwhite skipempty
242
+ syn region rustAsmSymPath start =" \S " end =" ,\| )" me =s - 1 contained contains =rustComment.*,rustIdentifier
243
+
244
+ " Const
245
+ syn region rustAsmConstBalancedParens start =" (" ms =s + 1 end =" )" contained contains =@rustAsmConstExpr
246
+ syn cluster rustAsmConstExpr contains =rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens
247
+ syn region rustAsmConst start =" const" end =" ,\| )" me =s - 1 contained contains =rustStorage,@rustAsmConstExpr
248
+
249
+ " Options
250
+ syn region rustAsmOptionsGroup start =" options\s *(" end =" )" contained contains =rustAsmOptions,rustAsmOptionsKey
251
+ syn keyword rustAsmOptionsKey options contained
252
+ syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained
253
+
233
254
" Folding rules {{{2
234
255
" Trivial folding rules to begin with.
235
256
" FIXME: use the AST to make really good folding
@@ -345,6 +366,10 @@ hi def link rustObsoleteExternMod Error
345
366
hi def link rustQuestionMark Special
346
367
hi def link rustAsync rustKeyword
347
368
hi def link rustAwait rustKeyword
369
+ hi def link rustAsmDirSpec rustKeyword
370
+ hi def link rustAsmSym rustKeyword
371
+ hi def link rustAsmOptions rustKeyword
372
+ hi def link rustAsmOptionsKey rustAttribute
348
373
349
374
" Other Suggestions:
350
375
" hi rustAttribute ctermfg=cyan
0 commit comments