3 elseif exists("b:current_syntax")
7 syn match asmDirective "\W\.[a-z][a-z]\+\>"
11 syn match asmType "\W\.long"
12 syn match asmType "\W\.ascii"
13 syn match asmType "\W\.asciz"
14 syn match asmType "\W\.byte"
15 syn match asmType "\W\.double"
16 syn match asmType "\W\.float"
17 syn match asmType "\W\.hword"
18 syn match asmType "\W\.int"
19 syn match asmType "\W\.octa"
20 syn match asmType "\W\.quad"
21 syn match asmType "\W\.short"
22 syn match asmType "\W\.single"
23 syn match asmType "\W\.space"
24 syn match asmType "\W\.string"
25 syn match asmType "\W\.word"
28 syn match decNumber "\<[1-9]\d*\>"
29 syn match octNumber "\<0[0-7]*\>"
30 syn match hexNumber "\<0[x][0-9a-f]*\>"
31 syn match binNumber "\<0[b][0-1]*\>"
33 syn match asmLabel "^[a-z0-9_]*:"he=e-1
34 syn match asmIdentifier "^\s\+[a-z_][a-z0-9_]*"
35 syn match asmIdentifier "^[0-9]:\s\+[a-z_][a-z0-9_]*"lc=2
37 syn match asmComment "#.*"hs=s+1
39 syn match asmInclude "\W\.include"
40 syn match asmCond "\W\.if\>"
41 syn match asmCond "\W\.else\>"
42 syn match asmCond "\W\.elseif"
43 syn match asmCond "\W\.endif"
44 syn match asmMacro "\W\.macro"
45 syn match asmMacro "\W\.endm"
50 " Define the default highlighting.
51 " For version 5.7 and earlier: only when not done already
52 " For version 5.8 and later: only when an item doesn't have highlighting yet
53 if version >= 508 || !exists("did_asm_syntax_inits")
55 let did_asm_syntax_inits = 1
56 command -nargs=+ HiLink hi link <args>
58 command -nargs=+ HiLink hi def link <args>
61 " The default methods for highlighting. Can be overridden later
62 HiLink asmSection Special
64 HiLink asmComment Comment
65 HiLink asmDirective Statement
67 HiLink asmInclude Include
68 HiLink asmCond PreCondit
71 HiLink hexNumber Number
72 HiLink decNumber Number
73 HiLink octNumber Number
74 HiLink binNumber Number
76 HiLink asmSpecialComment Comment
77 HiLink asmIdentifier Identifier
80 hi asmComment ctermfg=red
85 let b:current_syntax = "asm"