" Vim syntax file " Language: Haxe " Maintainer: Luca Deltodesco " Last Change: 2013 August 26 if exists("b:current_syntax") finish endif " provide fallback HiLink command if version < 508 command! -nargs=+ HaxeHiLink hi link else command! -nargs=+ HaxeHiLink hi def link endif " characters that cannot be in a haxe program (outside a string) syn match haxeError "[\\`]" " keywords " -------- syn keyword haxeTypedef typedef extends implements syn keyword haxeTypeDecl class enum abstract interface import using package from to syn keyword haxeStorageClass static inline public private macro dynamic extern override final syn match haxeTypedef "\.\s*\"ms=s+1 syn match haxeTypeDecl "^class\>" syn match haxeTypeDecl "[^.]\s*\"ms=s+1 syn keyword haxeException try catch throw syn keyword haxeRepeat for do while in syn keyword haxeLabel case syn keyword haxeConditional switch syn match haxeConditional "\<\#\@" syn keyword haxeConstant null never super this default get set syn keyword haxeFunction function __dollar__new new syn match haxeFunction "\<__[^_]\+__\>" syn keyword haxeKeyword untyped cast continue break return trace var syn match haxeKeyword "\$type" syn match haxeError "\<#\@" " type identifiers " ---------------- syn match haxeType "\<[A-Z][a-zA-Z_0-9]*\>" " operators " --------- " Did a lot of work here to ensure a lot of invalid operators are highlighted as errors. " put ,; in seperate highlight group to .: to avoid mistakes. syn match haxeOperator "[:?]" syn match haxeOperator2 "[;,]" " match . and ... as operators, and .. and more than 4 . as errors syn match haxeOperator "\.\@,<<,>>,>>> as operators syn match haxeOperator ">\@\|>>\|>>>\)>\@!" syn match haxeOperator "<\@)=? as operators " have to match &!<> seperate to avoid highlighting things like &&= &&& <<< as okay syn match haxeOperator "[+\-*/%^!]=\?=\@!" syn match haxeOperator "<\@\@]=\?[=>]\@!" syn match haxeOperator "&\@" syn match haxeFloat "\<\([\-+]\?[0-9]*\.\?[0-9]\+([eE][\-+]\?[0-9]\+)\?\)\>" syn keyword haxeBool true false " comments " -------- syn keyword haxeTODO contained TODO FIXME XXX syn match haxeComment "//.*" contains=haxeTODO,@Spell syn region haxeComment2 start=+/\*+ end=+\*/+ contains=haxeTODO,@Spell " preprocessing " ------------- syn match haxePre "\(#if\|#elseif\|#else\|#end\)" syn match haxePreError "#error" " regex " ----- syn region haxeRegex start=+\~\/+ end=+\/+ contains=haxeRegexEscape,haxeRegexError,@Spell syn match haxeRegexError contained "\\[^0-9bdnrstwxBDSW(){}\[\]\\$^*\-+|./?]" syn match haxeRegexEscape contained "\\[0-9bdnrstwxBDSW(){}\[\]\\$^*\-+|./?]" " meta " ---- syn match haxeMeta "@:\?[a-zA-Z_][a-zA-Z_0-9]*\>" syn match haxeCompilerMeta "@:\( \abstract \\|access \\|allow \\|annotation \\|arrayAccess \\|autoBuild \\|bind \\|bitmap \\|build \\|buildXml \\|callable \\|classCode \\|commutative \\|compilerGenerated \\|coreApi \\|coreType \\|cppFileCode \\|cppNamespaceCode \\|dce \\|debug \\|decl \\|defParam \\|delegate \\|depend \\|deprecated \\|event \\|enum \\|expose \\|extern \\|fakeEnum \\|file \\|final \\|font \\|forward \\|from \\|functionCode \\|functionTailCode \\|generic \\|genericBuild \\|getter \\|hack \\|headerClassCode \\|headerCode \\|headerNamespaceCode \\|hxGen \\|ifFeature \\|include \\|initPackage \\|internal \\|isVar \\|jsRequire \\|keep \\|keepInit \\|keepSub \\|luaRequire \\|macro \\|meta \\|multiType \\|multiReturn \\|native \\|nativeGen \\|noCompletion \\|noDebug \\|noDoc \\|noImportGlobal \\|noPackageRestrict \\|noStack \\|noUsing \\|notNull \\|ns \\|op \\|optional \\|overload \\|privateAccess \\|property \\|protected \\|public \\|publicFields \\|readOnly \\|remove \\|require \\|rtti \\|runtime \\|runtimeValue \\|selfCall \\|setter \\|sound \\|struct \\|suppressWarnings \\|throws \\|to \\|transient \\|unbound \\|unifyMinDynamic \\|unreflective \\|unsafe \\|usage \\|volatile \\)\>" syn sync ccomment haxeComment2 minlines=10 HaxeHiLink haxeMeta Macro HaxeHiLink haxeCompilerMeta Identifier HaxeHiLink haxeRegex String HaxeHiLink haxeDString String HaxeHiLink haxeSString Character HaxeHiLink haxeSpecialCharacter SpecialChar HaxeHiLink haxeIntSpecialChar SpecialChar HaxeHiLink haxeRegexEscape SpecialChar HaxeHiLink haxeErrorCharacter Error HaxeHiLink haxeRegexError Error HaxeHiLink haxeInterpolatedIdent Normal HaxeHiLink haxeInterpolated Normal HaxeHiLink haxeError Error HaxeHiLink haxeOperator Operator HaxeHiLink haxeOperator2 Identifier HaxeHiLink haxeSpecial SpecialChar HaxeHiLink haxeInt Number HaxeHiLink haxeFloat Float HaxeHiLink haxeBool Boolean HaxeHiLink haxeComment Comment HaxeHiLink haxeComment2 Comment HaxeHiLink haxeTODO Todo HaxeHiLink haxePre PreCondit HaxeHiLink haxePreError PreProc HaxeHiLink haxeType Type HaxeHiLink haxeTypedef Typedef HaxeHiLink haxeTypeDecl Keyword " Structure just gives me same colour as Type and looks bad. HaxeHiLink haxeStorageClass StorageClass HaxeHiLink haxeException Exception HaxeHiLink haxeRepeat Repeat HaxeHiLink haxeLabel Label HaxeHiLink haxeConditional Conditional HaxeHiLink haxeConstant Constant HaxeHiLink haxeFunction Function HaxeHiLink haxeKeyword Keyword delcommand HaxeHiLink let b:current_syntax = "haxe" let b:spell_options = "contained" " vim: ts=8