summaryrefslogblamecommitdiffstats
path: root/syntax/haxe.vim
blob: c28e892d41f055cc2a8a69244cec1f5c90e317b8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429

                                                                             










































































































































































































































































































































































































































                                                                                                                                                                                                                         

     
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
  
" Vim syntax file
" Language:     haxe
" Derived from:
"   http://tech.motion-twin.com/zip/haxe.vim
"   and http://www.cactusflower.org/haxe.vim
" Please check :help haxe.vim for comments on some of the options available.

set errorformat=%f\:%l\:\ characters\ %c-%*[^\ ]\ %m,%f\:%l\:\ %m

" Quit when a syntax file was already loaded
if !exists("main_syntax")
  if version < 600
    syntax clear
  elseif exists("b:current_syntax")
    finish
  endif
  let main_syntax='haxe'
endif

if version < 508
  command! -nargs=+ HaxeHiLink hi link <args>
else
  command! -nargs=+ HaxeHiLink hi def link <args>
endif

" some characters that cannot be in a haxe program (outside a string)
syn match     haxeError        "[\\@`]"
syn match     haxeError        "<<<\|=>\|<>\|||=\|&&=\|\*\/"

" use separate name so that it can be deleted in haxecc.vim
syn match     haxeError2       "#\|=<"
HaxeHiLink    haxeError2       haxeError

syn keyword   haxeExternal     import extern using
syn keyword   haxeDefine       package
syn keyword   haxeConditional  if else switch
syn keyword   haxeRepeat       while for do in
syn keyword   haxeBoolean      true false
syn keyword   haxeConstant     null
syn keyword   haxeTypedef      this super
syn keyword   haxeOperator     new cast 
syn keyword   haxeCoreType     Void Bool Int Float Dynamic
syn keyword   haxeStatement    return

syn keyword   haxeTypedef1     typedef
syn keyword   haxeStructure    var enum
syn keyword   haxeScopeDecl    private public
syn keyword   haxeScopeDecl2   static override final dynamic
syn keyword   haxeFunctionDef  function

syn keyword   haxeExceptions   throw try catch finally untyped
syn keyword   haxeAssert       assert
syn keyword   haxeMethodDecl   synchronized throws
syn keyword   haxeClassDecl    extends implements interface
syn match     haxeDelimiter    "[;:=\.]"
syn match     haxeOperator     "\(\.\.\.\|\*\|+\|-\|<<\|>>\|\/\|!\|||\|&&\|%\)"
syn match     haxeComparison   "\(==\|<=\|>=\|<\|>\|!=\)"
syn match     haxeOptionalVars contained "?[a-zA-Z_]\+"

syn match     haxeFunctionRef  "[_$a-zA-Z][_$a-zA-Z0-9_]*("me=e-1

" We use a match here to differentiate the keyword class from MyClass.class 
syn match     haxeTypedef      "\.\s*\<class\>"ms=s+1
syn match     haxeClassDecl    "^class\>"
syn match     haxeClassDecl    "[^.]\s*\<class\>"ms=s+1
syn keyword   haxeBranch       break continue nextgroup=haxeUserLabelRef skipwhite
syn match     haxeUserLabelRef "\k\+" contained
syn match     haxeClassDef     "\(^\s*class\s*\)\@<=[_$a-zA-Z][_$a-zA-Z0-9_]*" contains=haxeTypedef,haxeClassDecl

syn match     haxeLangClass    "\<System\>"
syn keyword   haxeLangClass    Array ArrayAccess Class Date DateTools EReg Enum
syn keyword   haxeLangClass    Hash IntHash IntIter Iterable Iterator Lambda
syn keyword   haxeLangClass    List Math Null Reflect Std String StringBug
syn keyword   haxeLangClass    StringTools Type UInt ValueType Xml XmlType

syn keyword   haxeFlashTop     flash
syn keyword   haxeFlashInner   accessibility deskdop display errors events
syn keyword   haxeFlashInner   external filters geom media net printing sampler
syn keyword   haxeFlashInner   system text ui utils xml display engine
syn keyword   haxeFlashFinal   BitmapData ExternalInterface BevelFilter
syn keyword   haxeFlashFinal   BitmapFilter BlurFilter ColorMatrixFilter ConvolutionFilter
syn keyword   haxeFlashFinal   DisplacementMapFilter DropShadowFilter GlowFilter GradientBevelFilter
syn keyword   haxeFlashFinal   GradientGlowFilter ColorTransform Matrix Point Rectangle Transform
syn keyword   haxeFlashFinal   FileReference FileReferenceList Capabilities IME Security StyleSheet
syn keyword   haxeFlashFinal   TextRenderer Accessibility Boot Button Camera Color ContextMenu
syn keyword   haxeFlashFinal   ContextMenuItem ExtendedKey Key Lib LoadVars
syn keyword   haxeFlashFinal   LocalConnection Microphone Mouse MovieClip
syn keyword   haxeFlashFinal   MovieClipLoader NetConnection NetStream PrintJob
syn keyword   haxeFlashFinal   Selection SelectionListener SharedObject Sound
syn keyword   haxeFlashFinal   Stage System TextField TextFormat TextSnapshot
syn keyword   haxeFlashFinal   Video XMLRequest XMLSocket
syn keyword   haxeFlash9Final  Accessibility AccessibilityImplementation
syn keyword   haxeFlash9Final  AccessibilityProperties Clipboard
syn keyword   haxeFlash9Final  ClipboardFormats ClipboardTransferMode AVM1Movie
syn keyword   haxeFlash9Final  ActionScriptVersion Bitmap BitmapData
syn keyword   haxeFlash9Final  BitmapDataChannel BlendMode CapsStyle
syn keyword   haxeFlash9Final  DisplayObject DisplayObjectContainer FrameLabel
syn keyword   haxeFlash9Final  GradientType Graphics GraphicsBitmapFill
syn keyword   haxeFlash9Final  GraphicsEndFill GraphicsGradientFill GraphicsPath
syn keyword   haxeFlash9Final  GraphicsPathCommand GraphicsPathWinding
syn keyword   haxeFlash9Final  GraphicsShaderFill GraphicsSolidFill
syn keyword   haxeFlash9Final  GraphicsStroke GraphicsTrianglePath
syn keyword   haxeFlash9Final  IBitmapDrawable IGraphicsData IGraphicsFill
syn keyword   haxeFlash9Final  IGraphicsPath IGraphicsStroke InteractiveObject
syn keyword   haxeFlash9Final  InterpolationMethod JointStyle
syn keyword   haxeFlash9Final  LineScaleMode Loader LoaderInfo MorphShape
syn keyword   haxeFlash9Final  MovieClip PixelSnapping SWFVersion
syn keyword   haxeFlash9Final  Scene Shader ShaderData ShaderInput ShaderJob ShaderParameter
syn keyword   haxeFlash9Final  ShaderParameterType ShaderPrecision Shape
syn keyword   haxeFlash9Final  SimpleButton SpreadMethod Sprite
syn keyword   haxeFlash9Final  Stage StageAlign StageDisplayState StageQuality
syn keyword   haxeFlash9Final  StageScaleMode TriangleCulling
syn keyword   haxeFlash9Final  EOFError Error IOError Illegal OperationError
syn keyword   haxeFlash9Final  InvalidSWFError MemoryError ScriptTimeoutError
syn keyword   haxeFlash9Final  StackOverflowError ActivityEventAsyncErrorEvent
syn keyword   haxeFlash9Final  ContextMenuEvent DataEvent ErrorEvent Event
syn keyword   haxeFlash9Final  EventDispatcher EventPhase FocusEvent
syn keyword   haxeFlash9Final  FullScreenEvent HTTPStatusEvent IEventDispatcher IMEEvent
syn keyword   haxeFlash9Final  IOErrorEvent KeyboardEvent MouseEvent
syn keyword   haxeFlash9Final  NetFilterEvent NetStatusEvent ProgressEvent
syn keyword   haxeFlash9Final  SampleDataEvent SecurityErrorEvent ShaderEvent StatusEvent
syn keyword   haxeFlash9Final  SyncEvent TextEvent TimerEvent WeakFunctionClosure WeakMethodClosure
syn keyword   haxeFlash9Final  ExternalInterface BevelFilter BitmapFilter
syn keyword   haxeFlash9Final  BitmapFilterQuality BitmapFilterType
syn keyword   haxeFlash9Final  BlurFilter ColorMatrixFilter ConvolutionFilter DisplacementMapFilter
syn keyword   haxeFlash9Final  DisplacementMapFilterMode DropShadowFilter
syn keyword   haxeFlash9Final  GlowFilter GradientBevelFilter
syn keyword   haxeFlash9Final  GradientGlowFilter ShaderFilter ColorTransform
syn keyword   haxeFlash9Final  Matrix Matrix3D Orientation3D
syn keyword   haxeFlash9Final  PerspectiveProjection Point Rectangle Transform
syn keyword   haxeFlash9Final  Utils3D Vector3D Camera ID3Info
syn keyword   haxeFlash9Final  Microphone Sound SoundChannel SoundCodec SoundLoaderContext SoundMixer
syn keyword   haxeFlash9Final  SoundTransform Video DynamicPropertyOutput FileFilter FileReference
syn keyword   haxeFlash9Final  FileReferenceList IDynamicPropertyOutput
syn keyword   haxeFlash9Final  IDynamicPropertyWriter LocalConnection
syn keyword   haxeFlash9Final  NetConnection NetStream NetStreamInfo NetSTreamPlayOptions
syn keyword   haxeFlash9Final  NetSTreamPlayTransitions ObjectEncoding Responder SharedObject
syn keyword   haxeFlash9Final  SharedObjectFlushStatus Socket URLLoader URLLoaderDataFormat URLRequest
syn keyword   haxeFlash9Final  URLRequestHeader URLRequestMethod URLStream
syn keyword   haxeFlash9Final  URLVariables XMLSocket PrintJob
syn keyword   haxeFlash9Final  PrintJobOptions PrintJobOrientation Api
syn keyword   haxeFlash9Final  DeleteObjectSample NewObjectSample
syn keyword   haxeFlash9Final  Sample StackFrame ApplicationDomain Capabilities FSCommand IME
syn keyword   haxeFlash9Final  IMEConversionMode JPEGLoaderContext
syn keyword   haxeFlash9Final  LoaderContext Security SecurityDomain
syn keyword   haxeFlash9Final  SecurityPanel System
syn keyword   haxeFlash9Final  BreakOpportunity CFFHinting ContentElement
syn keyword   haxeFlash9Final  DigitCase DigitWidth EastAsianJustifier ElementFormat FontDescription
syn keyword   haxeFlash9Final  FontLookup FontMetrics FontPosture FontWeight
syn keyword   haxeFlash9Final  GraphicElement GroupElement
syn keyword   haxeFlash9Final  JustificationStyle Kerning LIgatureLevel
syn keyword   haxeFlash9Final  LineJustification RenderingMode
syn keyword   haxeFlash9Final  SpaceJustifier TabAlignment TabStop TextBaseline TextBlock TextElement
syn keyword   haxeFlash9Final  TextJustifier TextLine TextLineCreationResult TextLineMirrorRegion
syn keyword   haxeFlash9Final  TextLineValidity TextRotation TypographicCase
syn keyword   haxeFlash9Final  AntiAliasType CSMSettings Font
syn keyword   haxeFlash9Final  FontStyle FontType GridFitType StaticText StyleSheet TextColorType
syn keyword   haxeFlash9Final  TextDisplayMode TextExtent TextField
syn keyword   haxeFlash9Final  TextFieldAutoSize TextFieldType TextFormat
syn keyword   haxeFlash9Final  TextFormatAlign TextFormatDisplay TextLineMetrics TextRenderer TextRun
syn keyword   haxeFlash9Final  TextSnapshot Trace ContextMenu ContextMenuBuiltInItems
syn keyword   haxeFlash9Final  ContextMenuClipboardItems ContextMenuItem KeyLocation Keyboard Mouse
syn keyword   haxeFlash9Final  MouseCursor ByteArray Dictionary Endian
syn keyword   haxeFlash9Final  IDataInput IDataOutput IExternalizable
syn keyword   haxeFlash9Final  Namespace ObjectInput ObjectOutput Proxy QName SetIntervalTimer Timer
syn keyword   haxeFlash9Final  TypedDictionary XML XMLDocument XMLList XMLNode
syn keyword   haxeFlash9Final  XMLNodeType XMLParser XMLTag
syn keyword   haxeFlash9Final  Boot Lib Memory Vector

HaxeHiLink    haxeLangObject   haxeConstant
syn cluster   haxeTop          add=haxeLangObject,haxeLangClass
syn cluster   haxeClasses      add=haxeLangClass,haxeFlashClass

if filereadable(expand("<sfile>:p:h")."/haxeid.vim")
  source <sfile>:p:h/haxeid.vim
endif

if !exists("haxe_no_trail_space_error")
  syn match   haxeSpaceError   "\s\+$"
endif
if !exists("haxe_no_tab_space_error")
  syn match   haxeSpaceError   " \+\t"me=e-1
endif

syn region    haxeLabelRegion  transparent matchgroup=haxeLabel start="\<case\>"
                               \ matchgroup=NONE end=":"
                               \ contains=haxeNumber,haxeChr,haxeNumber2
syn match     haxeUserLabel    "\({\s*\|^\s*\|,\s*\)\@<=[_$a-zA-Z][_$a-zA-Z0-9_]*:\s"he=e-1 contains=haxeDelimiter
                               \ contains=haxeLabel
syn keyword   haxeLabel        default never

" Everything - used in parenthases checking or something
syn cluster   haxeTop          add=haxeExternal,haxeError,haxeError,haxeBranch,
                               \ haxeLabelRegion,haxeLabel,haxeConditional,
                               \ haxeRepeat,haxeBoolean,haxeConstant,
                               \ haxeTypedef,haxeOperator,haxeType,haxeCoreType,
                               \ haxeStatement,haxeStorageClass,haxeAssert,
                               \ haxeExceptions,haxeMethodDecl,haxeClassDecl,
                               \ haxeClassDecl,haxeClassDecl,haxeScopeDecl,
                               \ haxeError,haxeError2,haxeUserLabel,
                               \ haxeLangObject,haxeFlashTop,haxeFlashInner,
                               \ haxeFlashFinal,haxeFlash9Final,haxeFunctionRef,
                               \ haxeComparison,haxeOptionalVars

" Comments
syn keyword   haxeTodo         contained TODO FIXME XXX
if exists("haxe_comment_strings")
  syn region  haxeCmString     contained start=+"+ end=+"+ end=+$+
                               \ end=+\*/+me=s-1,he=s-1
                               \ contains=haxeSpecial,haxeCmStar,haxeSpecChr,@Spell
  syn region  haxeCm2String    contained start=+"+ end=+$\|"+
                               \ contains=haxeSpecial,haxeSpecChr,@Spell
  syn match   haxeCmCharacter  contained "'\\[^']\{1,6\}'" contains=haxeSpecChr
  syn match   haxeCmCharacter  contained "'\\''" contains=haxeSpecChr
  syn match   haxeCmCharacter  contained "'[^\\]'"
  syn cluster haxeCmSpecial    add=haxeCmString,haxeCmCharacter,haxeNumber,haxeNumber2
  syn cluster haxeCmSpecial2   add=haxeCm2String,haxeCmCharacter,haxeNumber,haxeNumber2
endif
syn region    haxeCm           start="/\*" end="\*/"
                               \ contains=@haxeCmSpecial,haxeTodo,@Spell
syn match     haxeCmStar       contained "^\s*\*[^/]"me=e-1
syn match     haxeCmStar       contained "^\s*\*$"
syn match     haxeLineCm       "//.*" contains=@haxeCmSpecial2,haxeTodo,@Spell
HaxeHiLink    haxeCmString     haxeDocTags
HaxeHiLink    haxeCm2String    haxeString
HaxeHiLink    haxeCmCharacter  haxeChr
syn cluster   haxeTop          add=haxeCm,haxeLineCm
if exists("haxe_haxedoc") || main_syntax == 'jsp'
  syntax case ignore
  " syntax coloring for haxedoc comments (HTML)
  " syntax include @haxeHtml <sfile>:p:h/html.vim
  " unlet b:current_syntax
  syn region  haxeDocCm        start="/\*\*" end="\*/" keepend
                               \ contains=haxeCmTitle,@haxeHtml,haxeDocTags,haxeTodo,@Spell,haxeProposedTags
  syn region  haxeCmTitle      contained matchgroup=haxeDocCm start="/\*\*"
                               \ matchgroup=haxeCmTitle keepend end="\.$"
                               \ end="\.[ \t\r<]"me=e-1
                               \ end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1
                               \ contains=@haxeHtml,haxeCmStar,haxeTodo,@Spell,haxeDocTags,haxeProposedTags
  syn region  haxeDocTags      contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" 
                               \ end="}"
  syn match   haxeDocTags      contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+"
                               \ contains=haxeDocParam
  syn match   haxeDocParam     contained "\s\S\+"
  syn match   haxeDocTags      contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
  syn match   haxeProposedTags contained "@\(category\|example\|tutorial\|index\|exclude\|todo\|internal\|obsolete\)\>"
  syntax case match
endif
syn match     haxeCm           "/\*\*/"  " Edge case


" Strings and constants
syn match     haxeSpecError    contained "\\."
"syn match     haxeSpecChrError contained "[^']"
syn match     haxeSpecChr      contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
syn match     haxeEregEscape   contained "\(\\\\\|\\/\)"
syn region    haxeEreg         start=+\~\/+ end=+\/[gims]*+ contains=haxeEregEscape

syn region    haxeString       start=+"+ end=+"+ contains=haxeSpecChr,haxeSpecError,@Spell
syn region    haxeSingleString start=+'+ end=+'+ 
syn match     haxeChr          "'[^']*'" contains=haxeSpecChr,haxeSpecChrError
syn match     haxeChr          "'\\''" contains=haxeSpecChr
syn match     haxeChr          "'[^\\]'"
syn match     haxeNumber       "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" contains=haxeSpecNum
"syn match     haxeNumber       "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
syn match     haxeNumber2      "\(\<\d\+\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" contains=haxeSpecNum
syn match     haxeNumber2      "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" contains=haxeSpecNum
syn match     haxeNumber2      "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" contains=haxeSpecNum
syn match     haxeSpecNum      contained "\(0[xX]\|[\.+-]\)"

syn region    haxeCondIf       start="#if \+!\?" end="\(\W\|$\)" skip="([A-Za-z0-9_ |&!]\+)"
syn region    haxeCondElseIf   start="#elseif \+!\?" end="\(\W\|$\)" skip="([A-Za-z0-9_ |&!]\+)"
syn match     haxeCondElse     "#else\s*$"
syn match     haxeCondEnd      "#end"
syn match     haxeCondError    "#else .*$"

" unicode characters
syn match     haxeSpecial      "\\u\d\{4\}"

syn match     haxeType         ":[a-zA-Z_\.]\+"
                               \ contains=haxeDelimiter,haxeCoreType,haxeFlashTop,haxeFlashInner,haxeFlashFinal,haxeFlash9Final

syn cluster   haxeTop          add=haxeString,haxeChr,haxeNumber,haxeNumber2
syn cluster   haxeTop          add=haxeSpecial,haxeStringError,haxeDelimiter,haxeType

syn keyword   haxeTraceFun     trace contained
syn region    haxeTrace        start=+\(^\s*\)\@<=trace(+ end=+);+ contains=haxeTraceFun

if exists("haxe_highlight_functions")
 if haxe_highlight_functions == "indent"
  syn match   haxeFuncDef      "^\(\t\| \{4\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)"
                               \ contains=haxeType,haxeStorageClass,@haxeClasses
  syn region  haxeFuncDef      start=+^\(\t\| \{4\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+
                               \ end=+)+ contains=haxeType,haxeStorageClass,@haxeClasses
  syn match   haxeFuncDef      "^  [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)"
                               \ contains=haxeType,haxeStorageClass,@haxeClasses
  syn region  haxeFuncDef      start=+^  [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+
                               \ end=+)+
                               \ contains=haxeType,haxeStorageClass,@haxeClasses
 else
  " This line catches method declarations at any indentation>0, but it assumes
  " two things:
  "   1. class names are always capitalized (ie: Button)
  "   2. method names are never capitalized (except constructors, of course)
  syn region  haxeFuncDef      start=+\s\+\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+
                               \ end=+)+
                               \ contains=haxeType,haxeStorageClass,haxeCm,haxeLineCm,@haxeClasses
 endif
 syn match    haxeBraces       "[{}]"
 syn cluster  haxeTop          add=haxeFuncDef,haxeBraces
endif

if exists("haxe_mark_braces_in_parens_as_errors")
  syn match   haxeInParen      contained "[{}]"
  HaxeHiLink  haxeInParen      haxeError
  syn cluster haxeTop          add=haxeInParen
endif

" catch errors caused by wrong parenthesis
syn region    haxeParenT       transparent matchgroup=haxeParen start="("
                               \ end=")" contains=@haxeTop,haxeParenT1
syn region    haxeParenT1      transparent matchgroup=haxeParen1 start="("
                               \ end=")" contains=@haxeTop,haxeParenT2 contained
syn region    haxeParenT2      transparent matchgroup=haxeParen2 start="("
                               \ end=")" contains=@haxeTop,haxeParenT  contained
syn match     haxeParenError   ")"
HaxeHiLink    haxeParenError   haxeError


if !exists("haxe_minlines")
  let haxe_minlines = 5000
endif
exec "syn sync ccomment haxeCm minlines=" . haxe_minlines
syn sync linebreaks=30

" The default highlighting.
if version >= 508 || !exists("did_haxe_syn_inits")
  if version < 508
    let did_haxe_syn_inits = 1
  endif

  HaxeHiLink  haxeFunctionDef  Identifier
  HaxeHiLink  haxeFuncDef      Identifier
  HaxeHiLink  haxeFunctionRef  Function
  HaxeHiLink  haxeBraces       Function
  HaxeHiLink  haxeBranch       Conditional
  HaxeHiLink  haxeUserLabelRef haxeUserLabel
  HaxeHiLink  haxeLabel        Label
  HaxeHiLink  haxeUserLabel    Label
  HaxeHiLink  haxeConditional  Conditional
  HaxeHiLink  haxeRepeat       Repeat
  HaxeHiLink  haxeExceptions   Exception
  HaxeHiLink  haxeAssert       Statement

  HaxeHiLink  haxeClassDef     Underlined
  HaxeHiLink  haxeStructure    Structure
  HaxeHiLink  haxeMethodDecl   haxeStorageClass
  HaxeHiLink  haxeClassDecl    Structure
  HaxeHiLink  haxeScopeDecl    StorageClass
  HaxeHiLink  haxeScopeDecl2   Tag
  HaxeHiLink  haxeBoolean      Boolean
  HaxeHiLink  haxeSpecial      Special
  HaxeHiLink  haxeSpecError    Error
  HaxeHiLink  haxeSpecChrError Error
  HaxeHiLink  haxeString       String
  HaxeHiLink  haxeSingleString Character

  HaxeHiLink  haxeEreg         Number
  HaxeHiLink  haxeEregEscape   Debug
  HaxeHiLink  haxeChr          Character
  HaxeHiLink  haxeSpecChr      SpecialChar
  HaxeHiLink  haxeNumber       Number
  HaxeHiLink  haxeNumber2      Float
  HaxeHiLink  haxeSpecNum      Boolean
  HaxeHiLink  haxeError        Error
  HaxeHiLink  haxeStringError  Debug
  HaxeHiLink  haxeStatement    Statement
  HaxeHiLink  haxeOperator     Operator
  HaxeHiLink  haxeComparison   Repeat
  HaxeHiLink  haxeTraceFun     SpecialComment
  HaxeHiLink  haxeTrace        Comment
  HaxeHiLink  haxeDelimiter    Delimiter

  HaxeHiLink  haxeCm           Comment
  HaxeHiLink  haxeDocCm        Comment
  HaxeHiLink  haxeLineCm       Comment
  HaxeHiLink  haxeConstant     Constant
  HaxeHiLink  haxeTypedef      Typedef
  HaxeHiLink  haxeTypedef1     Typedef
  HaxeHiLink  haxeTodo         Todo
  HaxeHiLink  haxeLangClass    Special
  HaxeHiLink  haxeFlashClass   Keyword
  HaxeHiLink  haxeFunction     Function
  HaxeHiLink  haxeCmTitle      Special
  HaxeHiLink  haxeDocTags      SpecialComment
  HaxeHiLink  haxeProposedTags SpecialComment
  HaxeHiLink  haxeCmStar       Comment

  HaxeHiLink  haxeDocParam     Function
  HaxeHiLink  haxeCoreType     Keyword
  HaxeHiLink  haxeType         Type
  HaxeHiLink  haxeExternal     Include
  HaxeHiLink  haxeDefine       Define
  HaxeHiLink  htmlComment      Special
  HaxeHiLink  htmlCommentPart  Special
  HaxeHiLink  haxeSpaceError   Error
  HaxeHiLink  haxeCondIf       PreCondit
  HaxeHiLink  haxeCondElseIf   PreCondit
  HaxeHiLink  haxeCondElse     PreProc
  HaxeHiLink  haxeCondEnd      PreProc

  HaxeHiLink  haxeCondError    Error

  HaxeHiLink  haxeFlashTop     PreProc
  HaxeHiLink  haxeFlashInner   Macro
  HaxeHiLink  haxeFlashFinal   Define
  HaxeHiLink  haxeFlash9Final  Define

  HaxeHiLink  haxeOptionalVars Identifier
endif

delcommand HaxeHiLink
let b:current_syntax = "haxe"
if main_syntax == 'haxe'
  unlet main_syntax
endif
let b:spell_options="contained"

endif