annotate runtime/syntax/asm.vim @ 1624:18ee39301b82 v7.2a

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 22:58:06 +0000
parents 3fc0f57ecb91
children f3c987fb99b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: GNU Assembler
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: 2002 Sep 19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " storage types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn match asmType "\.long"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match asmType "\.ascii"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn match asmType "\.asciz"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match asmType "\.byte"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match asmType "\.double"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match asmType "\.float"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match asmType "\.hword"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match asmType "\.int"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match asmType "\.octa"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match asmType "\.quad"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match asmType "\.short"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match asmType "\.single"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match asmType "\.space"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match asmType "\.string"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match asmType "\.word"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match asmIdentifier "[a-z_][a-z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Various #'s as defined by GAS ref manual sec 3.6.2.1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Technically, the first decNumber def is actually octal,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " since the value of 0-7 octal is the same as 0-7 decimal,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " I prefer to map it as decimal:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match decNumber "0\+[1-7]\=[\t\n$,; ]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match decNumber "[1-9]\d*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match octNumber "0[0-7][0-7]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match hexNumber "0[xX][0-9a-fA-F]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match binNumber "0[bB][0-1]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match asmSpecialComment ";\*\*\*.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match asmComment ";.*"hs=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match asmInclude "\.include"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match asmCond "\.if"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match asmCond "\.else"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match asmCond "\.endif"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match asmMacro "\.macro"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match asmMacro "\.endm"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match asmDirective "\.[a-z][a-z]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 if version >= 508 || !exists("did_asm_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 let did_asm_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " The default methods for highlighting. Can be overridden later
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink asmSection Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink asmLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink asmComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink asmDirective Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 HiLink asmInclude Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 HiLink asmCond PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 HiLink asmMacro Macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 HiLink hexNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 HiLink decNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 HiLink octNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 HiLink binNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink asmSpecialComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 HiLink asmIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink asmType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " My default color overrides:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " hi asmSpecialComment ctermfg=red
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " hi asmIdentifier ctermfg=lightcyan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 " hi asmType ctermbg=black ctermfg=brown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 let b:current_syntax = "asm"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 " vim: ts=8