annotate runtime/syntax/d.vim @ 2501:c43e99e9baaf vim73

Fix: ml_get errors when using undo with 'virtualedit'.
author Bram Moolenaar <bram@vim.org>
date Sat, 07 Aug 2010 12:54:12 +0200
parents 277085346a0d
children e8a482a7fa6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
1 " Vim syntax file for the D programming language (version 1.053 and 2.039).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
3 " Language: D
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
4 " Maintainer: Jason Mills<jasonmills@nf.sympatico.ca>
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
5 " Last Change: 2010 Jan 07
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
6 " Version: 0.18
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
7 "
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
8 " Contributors:
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
9 " - Kirk McDonald: version 0.17 updates, with minor modifications
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
10 " (http://paste.dprogramming.com/dplmb7qx?view=hidelines)
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
11 " - Jesse K. Phillips: patch for some keywords and attributes (annotations), with modifications
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
12 " - Tim Keating: patch to fix a bug in highlighting the `\` literal
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
13 " - Frank Benoit: Fixed a bug that caused some identifiers and numbers to highlight as octal number errors.
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
14 "
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
15 " Please email me with bugs, comments, and suggestions.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Options:
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
18 " d_comment_strings - Set to highlight strings and numbers in comments.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 "
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
20 " d_hl_operator_overload - Set to highlight D's specially named functions
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
21 " that when overloaded implement unary and binary operators (e.g. opCmp).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " Todo:
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
24 " - Determine a better method of sync'ing than simply setting minlines
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
25 " to a large number.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 "
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
27 " - Several keywords (e.g., in, out, inout) are both storage class and
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
28 " statements, depending on their context. Perhaps use pattern matching to
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
29 " figure out which and highlight appropriately. For now I have made such
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
30 " keywords storage classes so their highlighting is consistent with other
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
31 " keywords that are commonly used with them, but are true storage classes,
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
32 " such as lazy. Similarly, I made some statement keywords (e.g. body) storage
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
33 " classes.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " - Mark contents of the asm statement body as special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 "
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
37 " - Maybe highlight the 'exit', 'failure', and 'success' parts of the
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
38 " scope() statement.
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
39 "
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
40 " - Highlighting DDoc comments.
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
41 "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Keyword definitions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 "
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
50 syn keyword dExternal import package module extern
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
51 syn keyword dConditional if else switch
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
52 syn keyword dBranch goto break continue
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
53 syn keyword dRepeat while for do foreach foreach_reverse
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
54 syn keyword dBoolean true false
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
55 syn keyword dConstant null
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
56 syn keyword dConstant __FILE__ __LINE__ __EOF__ __VERSION__
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
57 syn keyword dConstant __DATE__ __TIME__ __TIMESTAMP__ __VENDOR__
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
58
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
59 syn keyword dTypedef alias typedef
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
60 syn keyword dStructure template interface class struct union
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
61 syn keyword dEnum enum
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
62 syn keyword dOperator new delete typeof typeid cast align is
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
63 syn keyword dOperator this super
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 if exists("d_hl_operator_overload")
557
862863033fdd updated for version 7.0158
vimboss
parents: 199
diff changeset
65 syn keyword dOpOverload opNeg opCom opPostInc opPostDec opCast opAdd opSub opSub_r
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
66 syn keyword dOpOverload opMul opDiv opDiv_r opMod opMod_r opAnd opOr opXor
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
67 syn keyword dOpOverload opShl opShl_r opShr opShr_r opUShr opUShr_r opCat
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
68 syn keyword dOpOverload opCat_r opEquals opEquals opCmp
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
69 syn keyword dOpOverload opAssign opAddAssign opSubAssign opMulAssign opDivAssign
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
70 syn keyword dOpOverload opModAssign opAndAssign opOrAssign opXorAssign
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
71 syn keyword dOpOverload opShlAssign opShrAssign opUShrAssign opCatAssign
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
72 syn keyword dOpOverload opIndex opIndexAssign opCall opSlice opSliceAssign opPos
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
73 syn keyword dOpOverload opAdd_r opMul_r opAnd_r opOr_r opXor_r opIn opIn_r
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
74 syn keyword dOpOverload opPow opDispatch opStar opDot opApply opApplyReverse
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 endif
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
76 syn keyword dType ushort int uint long ulong float
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
77 syn keyword dType void byte ubyte double bit char wchar ucent cent
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
78 syn keyword dType short bool dchar string wstring dstring
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
79 syn keyword dType real ireal ifloat idouble creal cfloat cdouble
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
80 syn keyword dDebug deprecated unittest
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
81 syn keyword dExceptions throw try catch finally
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
82 syn keyword dScopeDecl public protected private export
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
83 syn keyword dStatement version debug return with
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
84 syn keyword dStatement function delegate __traits asm mixin macro
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
85 syn keyword dStorageClass in out inout ref lazy scope body
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
86 syn keyword dStorageClass pure nothrow
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
87 syn keyword dStorageClass auto static override final abstract volatile __gshared __thread
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
88 syn keyword dStorageClass synchronized immutable shared const invariant lazy
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
89 syn keyword dPragma pragma
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
91 " Attributes/annotations
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
92 syn match dAnnotation "@[_$a-zA-Z][_$a-zA-Z0-9_]*\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " Assert is a statement and a module name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match dAssert "^assert\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match dAssert "[^.]\s*\<assert\>"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
98 " dTokens is used by the token string highlighting
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
99 syn cluster dTokens contains=dExternal,dConditional,dBranch,dRepeat,dBoolean
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
100 syn cluster dTokens add=dConstant,dTypedef,dStructure,dOperator,dOpOverload
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
101 syn cluster dTokens add=dType,dDebug,dExceptions,dScopeDecl,dStatement
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
102 syn cluster dTokens add=dStorageClass,dPragma,dAssert,dAnnotation
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
103
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 " Marks contents of the asm statment body as special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 " TODO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 "syn match dAsmStatement "\<asm\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 "syn region dAsmBody start="asm[\n]*\s*{"hs=e+1 end="}"he=e-1 contains=dAsmStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 "hi def link dAsmBody dUnicode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 "hi def link dAsmStatement dStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " Labels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " We contain dScopeDecl so public: private: etc. are not highlighted like labels
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
116 syn match dUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=dLabel,dScopeDecl,dEnum
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
117 syn keyword dLabel case default
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
119 syn cluster dTokens add=dUserLabel,dLabel
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
120
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 "
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
123 syn keyword dTodo contained TODO FIXME TEMP REFACTOR REVIEW HACK BUG XXX
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
124 syn match dCommentStar contained "^\s*\*[^/]"me=e-1
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
125 syn match dCommentStar contained "^\s*\*$"
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
126 syn match dCommentPlus contained "^\s*+[^/]"me=e-1
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
127 syn match dCommentPlus contained "^\s*+$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 if exists("d_comment_strings")
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
129 syn region dBlockCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=dCommentStar,dUnicode,dEscSequence,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
130 syn region dNestedCommentString contained start=+"+ end=+"+ end="+"me=s-1,he=s-1 contains=dCommentPlus,dUnicode,dEscSequence,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
131 syn region dLineCommentString contained start=+"+ end=+$\|"+ contains=dUnicode,dEscSequence,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
132 syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
133 syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
134 syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 else
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
136 syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
137 syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
138 syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
141 hi link dLineCommentString dBlockCommentString
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
142 hi link dBlockCommentString dString
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
143 hi link dNestedCommentString dString
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
144 hi link dCommentStar dBlockComment
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
145 hi link dCommentPlus dNestedComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
147 syn cluster dTokens add=dBlockComment,dNestedComment,dLineComment
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
148
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
149 " /+ +/ style comments and strings that span multiple lines can cause
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
150 " problems. To play it safe, set minlines to a large number.
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
151 syn sync minlines=200
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
152 " Use ccomment for /* */ style comments
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
153 syn sync ccomment dBlockComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 " Characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 syn match dSpecialCharError contained "[^']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
199
3b32f6b507fa updated for version 7.0059
vimboss
parents: 17
diff changeset
159 " Escape sequences (oct,specal char,hex,wchar, character entities \&xxx;)
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
160 " These are not contained because they are considered string literals.
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
161 syn match dEscSequence "\\\(\o\{1,3}\|[\"\\'\\?ntbrfva]\|u\x\{4}\|U\x\{8}\|x\x\x\)"
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
162 syn match dEscSequence "\\&[^;& \t]\+;"
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
163 syn match dCharacter "'[^']*'" contains=dEscSequence,dSpecialCharError
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
164 syn match dCharacter "'\\''" contains=dEscSequence
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
165 syn match dCharacter "'[^\\]'"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
167 syn cluster dTokens add=dEscSequence,dCharacter
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
168
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 " Unicode characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 "
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
171 syn match dUnicode "\\u\d\{4\}"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 " String.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 "
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
175 syn region dString start=+"+ end=+"[cwd]\=+ skip=+\\\\\|\\"+ contains=dEscSequence,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
176 syn region dRawString start=+`+ end=+`[cwd]\=+ contains=@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
177 syn region dRawString start=+r"+ end=+"[cwd]\=+ contains=@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
178 syn region dHexString start=+x"+ end=+"[cwd]\=+ contains=@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
179 syn region dDelimString start=+q"\z(.\)+ end=+\z1"+ contains=@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
180 syn region dHereString start=+q"\z(\I\i*\)\n+ end=+\n\z1"+ contains=@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
181
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
182 " Nesting delimited string contents
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
183 "
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
184 syn region dNestParenString start=+(+ end=+)+ contained transparent contains=dNestParenString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
185 syn region dNestBrackString start=+\[+ end=+\]+ contained transparent contains=dNestBrackString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
186 syn region dNestAngleString start=+<+ end=+>+ contained transparent contains=dNestAngleString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
187 syn region dNestCurlyString start=+{+ end=+}+ contained transparent contains=dNestCurlyString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
188
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
189 " Nesting delimited strings
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
190 "
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
191 syn region dParenString matchgroup=dParenString start=+q"(+ end=+)"+ contains=dNestParenString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
192 syn region dBrackString matchgroup=dBrackString start=+q"\[+ end=+\]"+ contains=dNestBrackString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
193 syn region dAngleString matchgroup=dAngleString start=+q"<+ end=+>"+ contains=dNestAngleString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
194 syn region dCurlyString matchgroup=dCurlyString start=+q"{+ end=+}"+ contains=dNestCurlyString,@Spell
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
195
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
196 hi link dParenString dNestString
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
197 hi link dBrackString dNestString
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
198 hi link dAngleString dNestString
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
199 hi link dCurlyString dNestString
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
200
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
201 syn cluster dTokens add=dString,dRawString,dHexString,dDelimString,dNestString
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
202
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
203 " Token strings
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
204 "
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
205 syn region dNestTokenString start=+{+ end=+}+ contained contains=dNestTokenString,@dTokens
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
206 syn region dTokenString matchgroup=dTokenStringBrack transparent start=+q{+ end=+}+ contains=dNestTokenString,@dTokens
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
207
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
208 syn cluster dTokens add=dTokenString
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 " Numbers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 syn case ignore
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
213
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
214 syn match dDec display "\<\d[0-9_]*\(u\=l\=\|l\=u\=\)\>"
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
215
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 " Hex number
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
217 syn match dHex display "\<0x[0-9a-f_]\+\(u\=l\=\|l\=u\=\)\>"
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
218
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
219 syn match dOctal display "\<0[0-7_]\+\(u\=l\=\|l\=u\=\)\>"
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
220 " flag an octal number with wrong digits
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
221 syn match dOctalError display "\<0[0-7_]*[89][0-9_]*"
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
222
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
223 " binary numbers
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
224 syn match dBinary display "\<0b[01_]\+\(u\=l\=\|l\=u\=\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 "floating point without the dot
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
227 syn match dFloat display "\<\d[0-9_]*\(fi\=\|l\=i\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 "floating point number, with dot, optional exponent
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
229 syn match dFloat display "\<\d[0-9_]*\.[0-9_]*\(e[-+]\=[0-9_]\+\)\=[fl]\=i\="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 "floating point number, starting with a dot, optional exponent
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
231 syn match dFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 "floating point number, without dot, with exponent
17
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
233 "syn match dFloat display "\<\d\+e[-+]\=\d\+[fl]\=\>"
9be87deaeb52 updated for version 7.0009
vimboss
parents: 7
diff changeset
234 syn match dFloat display "\<\d[0-9_]*e[-+]\=[0-9_]\+[fl]\=\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 "floating point without the dot
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
237 syn match dHexFloat display "\<0x[0-9a-f_]\+\(fi\=\|l\=i\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 "floating point number, with dot, optional exponent
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
239 syn match dHexFloat display "\<0x[0-9a-f_]\+\.[0-9a-f_]*\(p[-+]\=[0-9_]\+\)\=[fl]\=i\="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 "floating point number, without dot, with exponent
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
241 syn match dHexFloat display "\<0x[0-9a-f_]\+p[-+]\=[0-9_]\+[fl]\=i\=\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
243 syn cluster dTokens add=dDec,dHex,dOctal,dOctalError,dBinary,dFloat,dHexFloat
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
244
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 " Pragma (preprocessor) support
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 " TODO: Highlight following Integer and optional Filespec.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 syn region dPragma start="#\s*\(line\>\)" skip="\\$" end="$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 hi def link dBinary Number
739
6e8086ed3b4b updated for version 7.0222
vimboss
parents: 557
diff changeset
255 hi def link dDec Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 hi def link dHex Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 hi def link dOctal Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 hi def link dFloat Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 hi def link dHexFloat Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 hi def link dDebug Debug
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 hi def link dBranch Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 hi def link dConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 hi def link dLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 hi def link dUserLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 hi def link dRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 hi def link dExceptions Exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 hi def link dAssert Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 hi def link dStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 hi def link dScopeDecl dStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 hi def link dStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 hi def link dBoolean Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 hi def link dUnicode Special
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
273 hi def link dTokenStringBrack String
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
274 hi def link dHereString String
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
275 hi def link dNestString String
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
276 hi def link dDelimString String
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 hi def link dRawString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 hi def link dString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 hi def link dHexString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 hi def link dCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 hi def link dEscSequence SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 hi def link dSpecialCharError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 hi def link dOctalError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 hi def link dOperator Operator
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
285 hi def link dOpOverload Identifier
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 hi def link dConstant Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 hi def link dTypedef Typedef
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
288 hi def link dEnum Structure
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 hi def link dStructure Structure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 hi def link dTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 hi def link dType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 hi def link dLineComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 hi def link dBlockComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 hi def link dNestedComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 hi def link dExternal Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 hi def link dPragma PreProc
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
297 hi def link dAnnotation PreProc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 let b:current_syntax = "d"
2043
277085346a0d Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 856
diff changeset
300
557
862863033fdd updated for version 7.0158
vimboss
parents: 199
diff changeset
301 " vim: ts=8 noet