blob: 25318d8c4cedd8efc11809cd44ed260d02b3f85f [file] [log] [blame]
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +02001" Vim syntax file for the D programming language (version 1.053 and 2.047).
Bram Moolenaar071d4272004-06-13 20:20:40 +00002"
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +02003" Language: D
4" Maintainer: Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
Bram Moolenaar6be7f872012-01-20 21:08:56 +01005" Last Change: 2012 Jan 11
6" Version: 0.24
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +01007"
8" Contributors:
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +02009" - Jason Mills <jasonmills@nf.sympatico.ca>: original Maintainer
Bram Moolenaar6be7f872012-01-20 21:08:56 +010010" - Kirk McDonald
11" - Tim Keating
12" - Frank Benoit
13" - Shougo Matsushita <Shougo.Matsu@gmail.com>
14" - Ellery Newcomer
15" - Steven N. Oliver
16" - Sohgo Takeuchi
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +010017"
Bram Moolenaar6be7f872012-01-20 21:08:56 +010018" Please submit bugs/comments/suggestions to the github repo:
19" https://github.com/he-the-great/d.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000020"
21" Options:
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +010022" d_comment_strings - Set to highlight strings and numbers in comments.
Bram Moolenaar071d4272004-06-13 20:20:40 +000023"
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +010024" d_hl_operator_overload - Set to highlight D's specially named functions
25" that when overloaded implement unary and binary operators (e.g. opCmp).
Bram Moolenaar071d4272004-06-13 20:20:40 +000026"
Bram Moolenaar6be7f872012-01-20 21:08:56 +010027" d_hl_object_types - Set to highlight some common types from object.di.
Bram Moolenaar071d4272004-06-13 20:20:40 +000028
29" Quit when a syntax file was already loaded
30if exists("b:current_syntax")
31 finish
32endif
33
Bram Moolenaar6be7f872012-01-20 21:08:56 +010034" Support cpoptions
35let s:cpo_save = &cpo
36set cpo&vim
37
38" Set the current syntax to be known as d
39let b:current_syntax = "d"
40
Bram Moolenaar071d4272004-06-13 20:20:40 +000041" Keyword definitions
42"
Bram Moolenaar6be7f872012-01-20 21:08:56 +010043syn keyword dExternal import module
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020044syn keyword dConditional if else switch
45syn keyword dBranch goto break continue
46syn keyword dRepeat while for do foreach foreach_reverse
47syn keyword dBoolean true false
48syn keyword dConstant null
49syn keyword dConstant __FILE__ __LINE__ __EOF__ __VERSION__
50syn keyword dConstant __DATE__ __TIME__ __TIMESTAMP__ __VENDOR__
51syn keyword dTypedef alias typedef
52syn keyword dStructure template interface class struct union
53syn keyword dEnum enum
54syn keyword dOperator new delete typeof typeid cast align is
55syn keyword dOperator this super
Bram Moolenaar071d4272004-06-13 20:20:40 +000056if exists("d_hl_operator_overload")
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020057 syn keyword dOpOverload opNeg opCom opPostInc opPostDec opCast opAdd
58 syn keyword dOpOverload opSub opSub_r opMul opDiv opDiv_r opMod
59 syn keyword dOpOverload opMod_r opAnd opOr opXor opShl opShl_r opShr
60 syn keyword dOpOverload opShr_r opUShr opUShr_r opCat
61 syn keyword dOpOverload opCat_r opEquals opEquals opCmp
62 syn keyword dOpOverload opAssign opAddAssign opSubAssign opMulAssign
63 syn keyword dOpOverload opDivAssign opModAssign opAndAssign
64 syn keyword dOpOverload opOrAssign opXorAssign opShlAssign
65 syn keyword dOpOverload opShrAssign opUShrAssign opCatAssign
66 syn keyword dOpOverload opIndex opIndexAssign opIndexOpAssign
67 syn keyword dOpOverload opCall opSlice opSliceAssign opSliceOpAssign
68 syn keyword dOpOverload opPos opAdd_r opMul_r opAnd_r opOr_r opXor_r
69 syn keyword dOpOverload opIn opIn_r opPow opDispatch opStar opDot
Bram Moolenaar6be7f872012-01-20 21:08:56 +010070 syn keyword dOpOverload opApply opApplyReverse opDollar
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020071 syn keyword dOpOverload opUnary opIndexUnary opSliceUnary
72 syn keyword dOpOverload opBinary opBinaryRight
Bram Moolenaar071d4272004-06-13 20:20:40 +000073endif
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020074
Bram Moolenaar6be7f872012-01-20 21:08:56 +010075syn keyword dType byte ubyte short ushort int uint long ulong cent ucent
76syn keyword dType void bool bit
77syn keyword dType float double real
78syn keyword dType ushort int uint long ulong float
79syn keyword dType char wchar dchar string wstring dstring
80syn keyword dType ireal ifloat idouble creal cfloat cdouble
81syn keyword dType size_t ptrdiff_t sizediff_t equals_t hash_t
82if exists("d_hl_object_types")
83 syn keyword dType Object Throwable AssociativeArray Error Exception
84 syn keyword dType Interface OffsetTypeInfo TypeInfo TypeInfo_Typedef
85 syn keyword dType TypeInfo_Enum TypeInfo_Pointer TypeInfo_Array
86 syn keyword dType TypeInfo_StaticArray TypeInfo_AssociativeArray
87 syn keyword dType TypeInfo_Function TypeInfo_Delegate TypeInfo_Class
88 syn keyword dType ClassInfo TypeInfo_Interface TypeInfo_Struct
89 syn keyword dType TypeInfo_Tuple TypeInfo_Const TypeInfo_Invariant
90 syn keyword dType TypeInfo_Shared TypeInfo_Inout MemberInfo
91 syn keyword dType MemberInfo_field MemberInfo_function ModuleInfo
92endif
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020093syn keyword dDebug deprecated unittest invariant
94syn keyword dExceptions throw try catch finally
Bram Moolenaar6be7f872012-01-20 21:08:56 +010095syn keyword dScopeDecl public protected private export package
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020096syn keyword dStatement debug return with
Bram Moolenaar6be7f872012-01-20 21:08:56 +010097syn keyword dStatement function delegate __ctfe mixin macro
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +020098syn keyword dStorageClass in out inout ref lazy body
99syn keyword dStorageClass pure nothrow
100syn keyword dStorageClass auto static override final abstract volatile
101syn keyword dStorageClass __gshared __thread
102syn keyword dStorageClass synchronized shared immutable const lazy
103syn keyword dPragma pragma
104syn keyword dIdentifier _arguments _argptr __vptr __monitor _ctor _dtor
105syn keyword dScopeIdentifier contained exit success failure
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100106syn keyword dTraitsIdentifier contained isAbstractClass isArithmetic isAssociativeArray
107syn keyword dTraitsIdentifier contained isFinalClass isFloating isIntegral isScalar
108syn keyword dTraitsIdentifier contained isStaticArray isUnsigned isVirtualFunction
109syn keyword dTraitsIdentifier contained isAbstractFunction isFinalFunction isStaticFunction
110syn keyword dTraitsIdentifier contained isRef isOut isLazy hasMember identifier getMember
111syn keyword dTraitsIdentifier contained getOverloads getVirtualFunctions parent compiles
112syn keyword dTraitsIdentifier contained classInstanceSize allMembers derivedMembers isSame
113syn keyword dExternIdentifier contained Windows Pascal Java System D
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200114syn keyword dAttribute contained safe trusted system
115syn keyword dAttribute contained property disable
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100116syn keyword dVersionIdentifier contained DigitalMars GNU LDC SDC D_NET
117syn keyword dVersionIdentifier contained X86 X86_64 ARM PPC PPC64 IA64 MIPS MIPS64 Alpha
118syn keyword dVersionIdentifier contained SPARC SPARC64 S390 S390X HPPA HPPA64 SH SH64
119syn keyword dVersionIdentifier contained linux Posix OSX FreeBSD Windows Win32 Win64
120syn keyword dVersionIdentifier contained OpenBSD BSD Solaris AIX SkyOS SysV3 SysV4 Hurd
121syn keyword dVersionIdentifier contained Cygwin MinGW
122syn keyword dVersionIdentifier contained LittleEndian BigEndian
123syn keyword dVersionIdentifier contained D_InlineAsm_X86 D_InlineAsm_X86_64
124syn keyword dVersionIdentifier contained D_Version2 D_Coverage D_Ddoc D_LP64 D_PIC
125syn keyword dVersionIdentifier contained unittest none all
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200126
127" Highlight the sharpbang
128syn match dSharpBang "\%^#!.*" display
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100130" Attributes/annotations
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200131syn match dAnnotation "@[_$a-zA-Z][_$a-zA-Z0-9_]*\>" contains=dAttribute
132
133" Version Identifiers
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100134syn match dVersion "[^.]\<version\>"hs=s+1 nextgroup=dVersionInside
135syn match dVersion "^\<version\>" nextgroup=dVersionInside
136syn match dVersionInside "\s*([_a-zA-Z][_a-zA-Z0-9]*\>" transparent contained contains=dVersionIdentifier
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200137
138" Scope StorageClass
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100139syn match dStorageClass "\<scope\>"
140
141" Traits Expression
142syn match dStatement "\<__traits\>"
143
144" Extern Modifier
145syn match dExternal "\<extern\>"
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200146
147" Scope Identifiers
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100148syn match dScope "\<scope\s*([_a-zA-Z][_a-zA-Z0-9]*\>"he=s+5 contains=dScopeIdentifier
149
150" Traits Identifiers
151syn match dTraits "\<__traits\s*([_a-zA-Z][_a-zA-Z0-9]*\>"he=s+8 contains=dTraitsIdentifier
152
153" Necessary to highlight C++ in extern modifiers.
154syn match dExternIdentifier "C\(++\)\?" contained
155
156" Extern Identifiers
157syn match dExtern "\<extern\s*([_a-zA-Z][_a-zA-Z0-9\+]*\>"he=s+6 contains=dExternIdentifier
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200158
159" String is a statement and a module name.
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100160syn match dType "[^.]\<string\>"ms=s+1
161syn match dType "^\<string\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162
163" Assert is a statement and a module name.
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100164syn match dAssert "[^.]\<assert\>"ms=s+1
165syn match dAssert "^\<assert\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100167" dTokens is used by the token string highlighting
168syn cluster dTokens contains=dExternal,dConditional,dBranch,dRepeat,dBoolean
169syn cluster dTokens add=dConstant,dTypedef,dStructure,dOperator,dOpOverload
170syn cluster dTokens add=dType,dDebug,dExceptions,dScopeDecl,dStatement
171syn cluster dTokens add=dStorageClass,dPragma,dAssert,dAnnotation
172
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173
174" Labels
175"
176" We contain dScopeDecl so public: private: etc. are not highlighted like labels
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100177syn match dUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=dLabel,dScopeDecl,dEnum
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200178syn keyword dLabel case default
Bram Moolenaar071d4272004-06-13 20:20:40 +0000179
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100180syn cluster dTokens add=dUserLabel,dLabel
181
Bram Moolenaar071d4272004-06-13 20:20:40 +0000182" Comments
183"
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200184syn keyword dTodo contained TODO FIXME TEMP REFACTOR REVIEW HACK BUG XXX
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000185syn match dCommentStar contained "^\s*\*[^/]"me=e-1
186syn match dCommentStar contained "^\s*\*$"
187syn match dCommentPlus contained "^\s*+[^/]"me=e-1
188syn match dCommentPlus contained "^\s*+$"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000189if exists("d_comment_strings")
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000190 syn region dBlockCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=dCommentStar,dUnicode,dEscSequence,@Spell
191 syn region dNestedCommentString contained start=+"+ end=+"+ end="+"me=s-1,he=s-1 contains=dCommentPlus,dUnicode,dEscSequence,@Spell
192 syn region dLineCommentString contained start=+"+ end=+$\|"+ contains=dUnicode,dEscSequence,@Spell
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100193 syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell fold
194 syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell fold
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000195 syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000196else
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100197 syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell fold
198 syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell fold
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000199 syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000200endif
201
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000202hi link dLineCommentString dBlockCommentString
203hi link dBlockCommentString dString
204hi link dNestedCommentString dString
205hi link dCommentStar dBlockComment
206hi link dCommentPlus dNestedComment
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100208syn cluster dTokens add=dBlockComment,dNestedComment,dLineComment
209
Bram Moolenaar5baddf02006-03-12 21:53:56 +0000210" /+ +/ style comments and strings that span multiple lines can cause
211" problems. To play it safe, set minlines to a large number.
212syn sync minlines=200
213" Use ccomment for /* */ style comments
214syn sync ccomment dBlockComment
Bram Moolenaar071d4272004-06-13 20:20:40 +0000215
216" Characters
217"
218syn match dSpecialCharError contained "[^']"
219
Bram Moolenaarcd71fa32005-03-11 22:46:48 +0000220" Escape sequences (oct,specal char,hex,wchar, character entities \&xxx;)
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100221" These are not contained because they are considered string literals.
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000222syn match dEscSequence "\\\(\o\{1,3}\|[\"\\'\\?ntbrfva]\|u\x\{4}\|U\x\{8}\|x\x\x\)"
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100223syn match dEscSequence "\\&[^;& \t]\+;"
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000224syn match dCharacter "'[^']*'" contains=dEscSequence,dSpecialCharError
225syn match dCharacter "'\\''" contains=dEscSequence
226syn match dCharacter "'[^\\]'"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000227
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100228syn cluster dTokens add=dEscSequence,dCharacter
229
Bram Moolenaar071d4272004-06-13 20:20:40 +0000230" Unicode characters
231"
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000232syn match dUnicode "\\u\d\{4\}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000233
234" String.
235"
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100236syn region dString start=+"+ end=+"[cwd]\=+ skip=+\\\\\|\\"+ contains=dEscSequence,@Spell
237syn region dRawString start=+`+ end=+`[cwd]\=+ contains=@Spell
238syn region dRawString start=+r"+ end=+"[cwd]\=+ contains=@Spell
239syn region dHexString start=+x"+ end=+"[cwd]\=+ contains=@Spell
240syn region dDelimString start=+q"\z(.\)+ end=+\z1"+ contains=@Spell
241syn region dHereString start=+q"\z(\I\i*\)\n+ end=+\n\z1"+ contains=@Spell
242
243" Nesting delimited string contents
244"
245syn region dNestParenString start=+(+ end=+)+ contained transparent contains=dNestParenString,@Spell
246syn region dNestBrackString start=+\[+ end=+\]+ contained transparent contains=dNestBrackString,@Spell
247syn region dNestAngleString start=+<+ end=+>+ contained transparent contains=dNestAngleString,@Spell
248syn region dNestCurlyString start=+{+ end=+}+ contained transparent contains=dNestCurlyString,@Spell
249
250" Nesting delimited strings
251"
252syn region dParenString matchgroup=dParenString start=+q"(+ end=+)"+ contains=dNestParenString,@Spell
253syn region dBrackString matchgroup=dBrackString start=+q"\[+ end=+\]"+ contains=dNestBrackString,@Spell
254syn region dAngleString matchgroup=dAngleString start=+q"<+ end=+>"+ contains=dNestAngleString,@Spell
255syn region dCurlyString matchgroup=dCurlyString start=+q"{+ end=+}"+ contains=dNestCurlyString,@Spell
256
257hi link dParenString dNestString
258hi link dBrackString dNestString
259hi link dAngleString dNestString
260hi link dCurlyString dNestString
261
262syn cluster dTokens add=dString,dRawString,dHexString,dDelimString,dNestString
263
264" Token strings
265"
266syn region dNestTokenString start=+{+ end=+}+ contained contains=dNestTokenString,@dTokens
267syn region dTokenString matchgroup=dTokenStringBrack transparent start=+q{+ end=+}+ contains=dNestTokenString,@dTokens
268
269syn cluster dTokens add=dTokenString
Bram Moolenaar071d4272004-06-13 20:20:40 +0000270
271" Numbers
272"
273syn case ignore
Bram Moolenaar5baddf02006-03-12 21:53:56 +0000274
275syn match dDec display "\<\d[0-9_]*\(u\=l\=\|l\=u\=\)\>"
276
Bram Moolenaar071d4272004-06-13 20:20:40 +0000277" Hex number
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000278syn match dHex display "\<0x[0-9a-f_]\+\(u\=l\=\|l\=u\=\)\>"
Bram Moolenaar5baddf02006-03-12 21:53:56 +0000279
280syn match dOctal display "\<0[0-7_]\+\(u\=l\=\|l\=u\=\)\>"
281" flag an octal number with wrong digits
282syn match dOctalError display "\<0[0-7_]*[89][0-9_]*"
283
284" binary numbers
285syn match dBinary display "\<0b[01_]\+\(u\=l\=\|l\=u\=\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000286
287"floating point without the dot
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000288syn match dFloat display "\<\d[0-9_]*\(fi\=\|l\=i\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000289"floating point number, with dot, optional exponent
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000290syn match dFloat display "\<\d[0-9_]*\.[0-9_]*\(e[-+]\=[0-9_]\+\)\=[fl]\=i\="
Bram Moolenaar071d4272004-06-13 20:20:40 +0000291"floating point number, starting with a dot, optional exponent
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000292syn match dFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000293"floating point number, without dot, with exponent
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000294"syn match dFloat display "\<\d\+e[-+]\=\d\+[fl]\=\>"
295syn match dFloat display "\<\d[0-9_]*e[-+]\=[0-9_]\+[fl]\=\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000296
297"floating point without the dot
Bram Moolenaar5baddf02006-03-12 21:53:56 +0000298syn match dHexFloat display "\<0x[0-9a-f_]\+\(fi\=\|l\=i\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299"floating point number, with dot, optional exponent
Bram Moolenaar5baddf02006-03-12 21:53:56 +0000300syn match dHexFloat display "\<0x[0-9a-f_]\+\.[0-9a-f_]*\(p[-+]\=[0-9_]\+\)\=[fl]\=i\="
Bram Moolenaar071d4272004-06-13 20:20:40 +0000301"floating point number, without dot, with exponent
Bram Moolenaar5baddf02006-03-12 21:53:56 +0000302syn match dHexFloat display "\<0x[0-9a-f_]\+p[-+]\=[0-9_]\+[fl]\=i\=\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000303
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100304syn cluster dTokens add=dDec,dHex,dOctal,dOctalError,dBinary,dFloat,dHexFloat
305
Bram Moolenaar071d4272004-06-13 20:20:40 +0000306syn case match
307
308" Pragma (preprocessor) support
309" TODO: Highlight following Integer and optional Filespec.
310syn region dPragma start="#\s*\(line\>\)" skip="\\$" end="$"
311
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100312" Block
313"
314syn region dBlock start="{" end="}" transparent fold
315
Bram Moolenaar071d4272004-06-13 20:20:40 +0000316
317" The default highlighting.
318"
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200319hi def link dBinary Number
320hi def link dDec Number
321hi def link dHex Number
322hi def link dOctal Number
323hi def link dFloat Float
324hi def link dHexFloat Float
325hi def link dDebug Debug
326hi def link dBranch Conditional
327hi def link dConditional Conditional
328hi def link dLabel Label
329hi def link dUserLabel Label
330hi def link dRepeat Repeat
331hi def link dExceptions Exception
332hi def link dAssert Statement
333hi def link dStatement Statement
334hi def link dScopeDecl dStorageClass
335hi def link dStorageClass StorageClass
336hi def link dBoolean Boolean
337hi def link dUnicode Special
338hi def link dTokenStringBrack String
339hi def link dHereString String
340hi def link dNestString String
341hi def link dDelimString String
342hi def link dRawString String
343hi def link dString String
344hi def link dHexString String
345hi def link dCharacter Character
346hi def link dEscSequence SpecialChar
347hi def link dSpecialCharError Error
348hi def link dOctalError Error
349hi def link dOperator Operator
350hi def link dOpOverload Identifier
351hi def link dConstant Constant
352hi def link dTypedef Typedef
353hi def link dEnum Structure
354hi def link dStructure Structure
355hi def link dTodo Todo
356hi def link dType Type
357hi def link dLineComment Comment
358hi def link dBlockComment Comment
359hi def link dNestedComment Comment
360hi def link dExternal Include
361hi def link dPragma PreProc
362hi def link dAnnotation PreProc
363hi def link dSharpBang PreProc
364hi def link dAttribute StorageClass
365hi def link dIdentifier Identifier
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200366hi def link dVersion dStatement
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100367hi def link dVersionIdentifier Identifier
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200368hi def link dScope dStorageClass
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100369hi def link dScopeIdentifier Identifier
370hi def link dTraits dStatement
371hi def link dTraitsIdentifier Identifier
372hi def link dExtern dExternal
373hi def link dExternIdentifier Identifier
Bram Moolenaar9db9d9c2010-01-16 14:29:14 +0100374
Bram Moolenaar24ea3ba2010-09-19 19:01:21 +0200375" Marks contents of the asm statment body as special
376
377syn match dAsmStatement "\<asm\>"
378syn region dAsmBody start="asm[\n]*\s*{"hs=e+1 end="}"he=e-1 contains=dAsmStatement,dAsmOpCode
379
380hi def link dAsmBody dUnicode
381hi def link dAsmStatement dStatement
382hi def link dAsmOpCode Identifier
383
384syn keyword dAsmOpCode contained aaa aad aam aas adc
385syn keyword dAsmOpCode contained add addpd addps addsd addss
386syn keyword dAsmOpCode contained and andnpd andnps andpd andps
387syn keyword dAsmOpCode contained arpl bound bsf bsr bswap
388syn keyword dAsmOpCode contained bt btc btr bts call
389syn keyword dAsmOpCode contained cbw cdq clc cld clflush
390syn keyword dAsmOpCode contained cli clts cmc cmova cmovae
391syn keyword dAsmOpCode contained cmovb cmovbe cmovc cmove cmovg
392syn keyword dAsmOpCode contained cmovge cmovl cmovle cmovna cmovnae
393syn keyword dAsmOpCode contained cmovnb cmovnbe cmovnc cmovne cmovng
394syn keyword dAsmOpCode contained cmovnge cmovnl cmovnle cmovno cmovnp
395syn keyword dAsmOpCode contained cmovns cmovnz cmovo cmovp cmovpe
396syn keyword dAsmOpCode contained cmovpo cmovs cmovz cmp cmppd
397syn keyword dAsmOpCode contained cmpps cmps cmpsb cmpsd cmpss
398syn keyword dAsmOpCode contained cmpsw cmpxch8b cmpxchg comisd comiss
399syn keyword dAsmOpCode contained cpuid cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi
400syn keyword dAsmOpCode contained cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd
401syn keyword dAsmOpCode contained cvtps2pi cvtsd2si cvtsd2ss cvtsi2sd cvtsi2ss
402syn keyword dAsmOpCode contained cvtss2sd cvtss2si cvttpd2dq cvttpd2pi cvttps2dq
403syn keyword dAsmOpCode contained cvttps2pi cvttsd2si cvttss2si cwd cwde
404syn keyword dAsmOpCode contained da daa das db dd
405syn keyword dAsmOpCode contained de dec df di div
406syn keyword dAsmOpCode contained divpd divps divsd divss dl
407syn keyword dAsmOpCode contained dq ds dt dw emms
408syn keyword dAsmOpCode contained enter f2xm1 fabs fadd faddp
409syn keyword dAsmOpCode contained fbld fbstp fchs fclex fcmovb
410syn keyword dAsmOpCode contained fcmovbe fcmove fcmovnb fcmovnbe fcmovne
411syn keyword dAsmOpCode contained fcmovnu fcmovu fcom fcomi fcomip
412syn keyword dAsmOpCode contained fcomp fcompp fcos fdecstp fdisi
413syn keyword dAsmOpCode contained fdiv fdivp fdivr fdivrp feni
414syn keyword dAsmOpCode contained ffree fiadd ficom ficomp fidiv
415syn keyword dAsmOpCode contained fidivr fild fimul fincstp finit
416syn keyword dAsmOpCode contained fist fistp fisub fisubr fld
417syn keyword dAsmOpCode contained fld1 fldcw fldenv fldl2e fldl2t
418syn keyword dAsmOpCode contained fldlg2 fldln2 fldpi fldz fmul
419syn keyword dAsmOpCode contained fmulp fnclex fndisi fneni fninit
420syn keyword dAsmOpCode contained fnop fnsave fnstcw fnstenv fnstsw
421syn keyword dAsmOpCode contained fpatan fprem fprem1 fptan frndint
422syn keyword dAsmOpCode contained frstor fsave fscale fsetpm fsin
423syn keyword dAsmOpCode contained fsincos fsqrt fst fstcw fstenv
424syn keyword dAsmOpCode contained fstp fstsw fsub fsubp fsubr
425syn keyword dAsmOpCode contained fsubrp ftst fucom fucomi fucomip
426syn keyword dAsmOpCode contained fucomp fucompp fwait fxam fxch
427syn keyword dAsmOpCode contained fxrstor fxsave fxtract fyl2x fyl2xp1
428syn keyword dAsmOpCode contained hlt idiv imul in inc
429syn keyword dAsmOpCode contained ins insb insd insw int
430syn keyword dAsmOpCode contained into invd invlpg iret iretd
431syn keyword dAsmOpCode contained ja jae jb jbe jc
432syn keyword dAsmOpCode contained jcxz je jecxz jg jge
433syn keyword dAsmOpCode contained jl jle jmp jna jnae
434syn keyword dAsmOpCode contained jnb jnbe jnc jne jng
435syn keyword dAsmOpCode contained jnge jnl jnle jno jnp
436syn keyword dAsmOpCode contained jns jnz jo jp jpe
437syn keyword dAsmOpCode contained jpo js jz lahf lar
438syn keyword dAsmOpCode contained ldmxcsr lds lea leave les
439syn keyword dAsmOpCode contained lfence lfs lgdt lgs lidt
440syn keyword dAsmOpCode contained lldt lmsw lock lods lodsb
441syn keyword dAsmOpCode contained lodsd lodsw loop loope loopne
442syn keyword dAsmOpCode contained loopnz loopz lsl lss ltr
443syn keyword dAsmOpCode contained maskmovdqu maskmovq maxpd maxps maxsd
444syn keyword dAsmOpCode contained maxss mfence minpd minps minsd
445syn keyword dAsmOpCode contained minss mov movapd movaps movd
446syn keyword dAsmOpCode contained movdq2q movdqa movdqu movhlps movhpd
447syn keyword dAsmOpCode contained movhps movlhps movlpd movlps movmskpd
448syn keyword dAsmOpCode contained movmskps movntdq movnti movntpd movntps
449syn keyword dAsmOpCode contained movntq movq movq2dq movs movsb
450syn keyword dAsmOpCode contained movsd movss movsw movsx movupd
451syn keyword dAsmOpCode contained movups movzx mul mulpd mulps
452syn keyword dAsmOpCode contained mulsd mulss neg nop not
453syn keyword dAsmOpCode contained or orpd orps out outs
454syn keyword dAsmOpCode contained outsb outsd outsw packssdw packsswb
455syn keyword dAsmOpCode contained packuswb paddb paddd paddq paddsb
456syn keyword dAsmOpCode contained paddsw paddusb paddusw paddw pand
457syn keyword dAsmOpCode contained pandn pavgb pavgw pcmpeqb pcmpeqd
458syn keyword dAsmOpCode contained pcmpeqw pcmpgtb pcmpgtd pcmpgtw pextrw
459syn keyword dAsmOpCode contained pinsrw pmaddwd pmaxsw pmaxub pminsw
460syn keyword dAsmOpCode contained pminub pmovmskb pmulhuw pmulhw pmullw
461syn keyword dAsmOpCode contained pmuludq pop popa popad popf
462syn keyword dAsmOpCode contained popfd por prefetchnta prefetcht0 prefetcht1
463syn keyword dAsmOpCode contained prefetcht2 psadbw pshufd pshufhw pshuflw
464syn keyword dAsmOpCode contained pshufw pslld pslldq psllq psllw
465syn keyword dAsmOpCode contained psrad psraw psrld psrldq psrlq
466syn keyword dAsmOpCode contained psrlw psubb psubd psubq psubsb
467syn keyword dAsmOpCode contained psubsw psubusb psubusw psubw punpckhbw
468syn keyword dAsmOpCode contained punpckhdq punpckhqdq punpckhwd punpcklbw punpckldq
469syn keyword dAsmOpCode contained punpcklqdq punpcklwd push pusha pushad
470syn keyword dAsmOpCode contained pushf pushfd pxor rcl rcpps
471syn keyword dAsmOpCode contained rcpss rcr rdmsr rdpmc rdtsc
472syn keyword dAsmOpCode contained rep repe repne repnz repz
473syn keyword dAsmOpCode contained ret retf rol ror rsm
474syn keyword dAsmOpCode contained rsqrtps rsqrtss sahf sal sar
475syn keyword dAsmOpCode contained sbb scas scasb scasd scasw
476syn keyword dAsmOpCode contained seta setae setb setbe setc
477syn keyword dAsmOpCode contained sete setg setge setl setle
478syn keyword dAsmOpCode contained setna setnae setnb setnbe setnc
479syn keyword dAsmOpCode contained setne setng setnge setnl setnle
480syn keyword dAsmOpCode contained setno setnp setns setnz seto
481syn keyword dAsmOpCode contained setp setpe setpo sets setz
482syn keyword dAsmOpCode contained sfence sgdt shl shld shr
483syn keyword dAsmOpCode contained shrd shufpd shufps sidt sldt
484syn keyword dAsmOpCode contained smsw sqrtpd sqrtps sqrtsd sqrtss
485syn keyword dAsmOpCode contained stc std sti stmxcsr stos
486syn keyword dAsmOpCode contained stosb stosd stosw str sub
487syn keyword dAsmOpCode contained subpd subps subsd subss sysenter
488syn keyword dAsmOpCode contained sysexit test ucomisd ucomiss ud2
489syn keyword dAsmOpCode contained unpckhpd unpckhps unpcklpd unpcklps verr
490syn keyword dAsmOpCode contained verw wait wbinvd wrmsr xadd
491syn keyword dAsmOpCode contained xchg xlat xlatb xor xorpd
492syn keyword dAsmOpCode contained xorps
493syn keyword dAsmOpCode contained addsubpd addsubps fisttp haddpd haddps
494syn keyword dAsmOpCode contained hsubpd hsubps lddqu monitor movddup
495syn keyword dAsmOpCode contained movshdup movsldup mwait
496syn keyword dAsmOpCode contained pavgusb pf2id pfacc pfadd pfcmpeq
497syn keyword dAsmOpCode contained pfcmpge pfcmpgt pfmax pfmin pfmul
498syn keyword dAsmOpCode contained pfnacc pfpnacc pfrcp pfrcpit1 pfrcpit2
499syn keyword dAsmOpCode contained pfrsqit1 pfrsqrt pfsub pfsubr pi2fd
500syn keyword dAsmOpCode contained pmulhrw pswapd
501
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100502let &cpo = s:cpo_save
503unlet s:cpo_save