Use more modern haxe package, closes #340

This commit is contained in:
Adam Stankiewicz
2021-06-09 11:49:01 +02:00
parent ff8c1d7674
commit af4d6aa3cf
10 changed files with 611 additions and 398 deletions

View File

@@ -95,7 +95,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (Mustache and Handlebars syntax highlighting for mustache, hogan, hulk, hjs, handlebars, hbs, hdbs and hb files) - [handlebars](https://github.com/mustache/vim-mustache-handlebars) (Mustache and Handlebars syntax highlighting for mustache, hogan, hulk, hjs, handlebars, hbs, hdbs and hb files)
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (HAProxy syntax highlighting) - [haproxy](https://github.com/CH-DanReif/haproxy.vim) (HAProxy syntax highlighting)
- [haskell](https://github.com/neovimhaskell/haskell-vim) (Haskell syntax highlighting for hs, hs-boot, hsc, bpk and hsig files) - [haskell](https://github.com/neovimhaskell/haskell-vim) (Haskell syntax highlighting for hs, hs-boot, hsc, bpk and hsig files)
- [haxe](https://github.com/yaymukund/vim-haxe) (Haxe syntax highlighting for hx and hxsl files) - [haxe](https://github.com/jdonaldson/vaxe) (Haxe and HXML syntax highlighting for hx, hxsl, hxml and hss files)
- [hcl](https://github.com/b4b4r07/vim-hcl) (HCL syntax highlighting for hcl, nomad and workflow files) - [hcl](https://github.com/b4b4r07/vim-hcl) (HCL syntax highlighting for hcl, nomad and workflow files)
- [helm](https://github.com/towolf/vim-helm) - [helm](https://github.com/towolf/vim-helm)
- [help](https://github.com/neovim/neovim/tree/master/runtime) - [help](https://github.com/neovim/neovim/tree/master/runtime)

View File

@@ -112,6 +112,8 @@ if !exists('g:python_highlight_all')
call s:SetDefault('g:python_slow_sync', 1) call s:SetDefault('g:python_slow_sync', 1)
endif endif
" Some variables are needed for haxe loading
" We need it because scripts.vim in vim uses "set ft=" which cannot be " We need it because scripts.vim in vim uses "set ft=" which cannot be
" overridden with setf (and we can't use set ft= so our scripts.vim work) " overridden with setf (and we can't use set ft= so our scripts.vim work)
func! s:Setf(ft) func! s:Setf(ft)
@@ -2300,6 +2302,8 @@ endif
if !has_key(g:polyglot_is_disabled, 'haxe') if !has_key(g:polyglot_is_disabled, 'haxe')
au BufNewFile,BufRead *.hx,*.hxsl setf haxe au BufNewFile,BufRead *.hx,*.hxsl setf haxe
au BufNewFile,BufRead *.hxml setf hxml
au BufNewFile,BufRead *.hss setf hss
endif endif
if !has_key(g:polyglot_is_disabled, 'haskell') if !has_key(g:polyglot_is_disabled, 'haskell')

View File

@@ -229,6 +229,7 @@ let s:globs = {
\ 'hollywood': '*.hws', \ 'hollywood': '*.hws',
\ 'hostconf': '', \ 'hostconf': '',
\ 'hostsaccess': '', \ 'hostsaccess': '',
\ 'hss': '*.hss',
\ 'html': '*.html,*.htm,*.html.hl,*.inc,*.xht,*.xhtml', \ 'html': '*.html,*.htm,*.html.hl,*.inc,*.xht,*.xhtml',
\ 'html.handlebars': '*.handlebars,*.hbs,*.hdbs,*.hb', \ 'html.handlebars': '*.handlebars,*.hbs,*.hdbs,*.hb',
\ 'html.mustache': '*.mustache,*.hogan,*.hulk,*.hjs', \ 'html.mustache': '*.mustache,*.hogan,*.hulk,*.hjs',
@@ -236,6 +237,7 @@ let s:globs = {
\ 'htmldjango': '*.jinja,*.j2,*.jinja2', \ 'htmldjango': '*.jinja,*.j2,*.jinja2',
\ 'htmlm4': '*.html.m4', \ 'htmlm4': '*.html.m4',
\ 'httest': '*.htt,*.htb', \ 'httest': '*.htt,*.htb',
\ 'hxml': '*.hxml',
\ 'i3config': '*.i3.config,*.i3config,i3.config,i3config,.i3.config,.i3config', \ 'i3config': '*.i3.config,*.i3config,i3.config,i3config,.i3.config,.i3config',
\ 'ibasic': '*.iba,*.ibi', \ 'ibasic': '*.iba,*.ibi',
\ 'icalendar': '*.ics', \ 'icalendar': '*.ics',

19
indent/haxe.vim Normal file
View File

@@ -0,0 +1,19 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'haxe', 'indent/haxe.vim')
finish
endif
" Language: Haxe
" Maintainer: None! Wanna improve this?
" Last Change: 2007 Jan 22
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" C indenting is not too bad.
setlocal cindent
setlocal cinoptions+=j1,J1
setlocal indentkeys=0{,0},0),0],!^F,o,O,e
let b:undo_indent = "setl cin<"

View File

@@ -773,10 +773,19 @@ filetypes:
- hsig - hsig
--- ---
name: haxe name: haxe
remote: yaymukund/vim-haxe remote: jdonaldson/vaxe
filetypes: filetypes:
- name: haxe - name: haxe
linguist: Haxe linguist: Haxe
- name: hxml
linguist: HXML
- name: hss
extensions:
- hss
ignored_dirs:
- ftplugin
- autoload
- compiler
--- ---
name: hcl name: hcl
remote: b4b4r07/vim-hcl remote: b4b4r07/vim-hcl

View File

@@ -3,429 +3,270 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'haxe', 'syntax/haxe.vim')
endif endif
" Vim syntax file " Vim syntax file
" Language: haxe " Language: Haxe
" Derived from: " Maintainer: Luca Deltodesco <luca@deltaluca.me.uk>
" http://tech.motion-twin.com/zip/haxe.vim " Last Change: 2013 August 26
" 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 if exists("b:current_syntax")
" Quit when a syntax file was already loaded
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif
let main_syntax='haxe'
endif endif
" provide fallback HiLink command
if version < 508 if version < 508
command! -nargs=+ HaxeHiLink hi link <args> command! -nargs=+ HaxeHiLink hi link <args>
else else
command! -nargs=+ HaxeHiLink hi def link <args> command! -nargs=+ HaxeHiLink hi def link <args>
endif endif
" some characters that cannot be in a haxe program (outside a string) " characters that cannot be in a haxe program (outside a string)
syn match haxeError "[\\@`]" syn match haxeError "[\\`]"
syn match haxeError "<<<\|=>\|<>\|||=\|&&=\|\*\/"
" use separate name so that it can be deleted in haxecc.vim " keywords
syn match haxeError2 "#\|=<" " --------
HaxeHiLink haxeError2 haxeError 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 keyword haxeExternal import extern using syn match haxeTypedef "\.\s*\<class\>"ms=s+1
syn keyword haxeDefine package syn match haxeTypeDecl "^class\>"
syn keyword haxeConditional if else switch syn match haxeTypeDecl "[^.]\s*\<class\>"ms=s+1
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 haxeException try catch throw
syn keyword haxeStructure var enum syn keyword haxeRepeat for do while in
syn keyword haxeScopeDecl private public syn keyword haxeLabel case
syn keyword haxeScopeDecl2 static override final dynamic syn keyword haxeConditional switch
syn keyword haxeFunctionDef function syn match haxeConditional "\<\#\@<!\(if\|else\)\>"
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 keyword haxeExceptions throw try catch finally untyped syn match haxeError "\<#\@<!elseif\>"
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 " type identifiers
" ----------------
syn match haxeType "\<[A-Z][a-zA-Z_0-9]*\>"
" We use a match here to differentiate the keyword class from MyClass.class " operators
syn match haxeTypedef "\.\s*\<class\>"ms=s+1 " ---------
syn match haxeClassDecl "^class\>" " Did a lot of work here to ensure a lot of invalid operators are highlighted as errors.
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\>" " put ,; in seperate highlight group to .: to avoid mistakes.
syn keyword haxeLangClass Array ArrayAccess Class Date DateTools EReg Enum syn match haxeOperator "[:?]"
syn keyword haxeLangClass Hash IntHash IntIter Iterable Iterator Lambda syn match haxeOperator2 "[;,]"
syn keyword haxeLangClass List Math Null Reflect Std String StringBug
syn keyword haxeLangClass StringTools Type UInt ValueType Xml XmlType
syn keyword haxeFlashTop flash " match . and ... as operators, and .. and more than 4 . as errors
syn keyword haxeFlashInner accessibility deskdop display errors events syn match haxeOperator "\.\@<!\(\.\|\.\.\.\)\.\@!"
syn keyword haxeFlashInner external filters geom media net printing sampler syn match haxeError "\.\@<!\.\.\.\@!"
syn keyword haxeFlashInner system text ui utils xml display engine syn match haxeError "\.\{4,\}"
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 " match <,>,<<,>>,>>> as operators
syn cluster haxeTop add=haxeLangObject,haxeLangClass syn match haxeOperator ">\@<!\(>\|>>\|>>>\)>\@!"
syn cluster haxeClasses add=haxeLangClass,haxeFlashClass syn match haxeOperator "<\@<!\(<\|<<\)<\@!"
if filereadable(expand("<sfile>:p:h")."/haxeid.vim") " match &| in 1 or 2 as operator, and more than 2 as error
source <sfile>:p:h/haxeid.vim " match &&= and ||= as errors
endif syn match haxeOperator "&\@<!&&\?&\@!"
syn match haxeOperator "|\@<!||\?|\@!"
syn match haxeError "&\{3,\}\||\{3,}\|&&=\|||="
if !exists("haxe_no_trail_space_error") " match = in 1 or 2 as operator, and more than 2 as error
syn match haxeSpaceError "\s\+$" " match !== as an error
endif syn match haxeOperator "=\@<!==\?=\@!"
if !exists("haxe_no_tab_space_error") syn match haxeError "=\{3,\}\|!=="
syn match haxeSpaceError " \+\t"me=e-1
endif
syn region haxeLabelRegion transparent matchgroup=haxeLabel start="\<case\>" " match (+-*/%&!<>)=? as operators
\ matchgroup=NONE end=":" " have to match &!<> seperate to avoid highlighting things like &&= &&& <<< as okay
\ contains=haxeNumber,haxeChr,haxeNumber2 syn match haxeOperator "[+\-*/%^!]=\?=\@!"
syn match haxeUserLabel "\({\s*\|^\s*\|,\s*\)\@<=[_$a-zA-Z][_$a-zA-Z0-9_]*:\s"he=e-1 contains=haxeDelimiter syn match haxeOperator "<\@<!<=\?[=<]\@!"
\ contains=haxeLabel syn match haxeOperator ">\@<![>]=\?[=>]\@!"
syn keyword haxeLabel default never syn match haxeOperator "&\@<!&=\?[=&]\@!"
syn match haxeOperator "|\@<!|=\?[=|]\@!"
" Everything - used in parenthases checking or something " string literals
syn cluster haxeTop add=haxeExternal,haxeError,haxeError,haxeBranch, " ---------------
\ haxeLabelRegion,haxeLabel,haxeConditional, " Did a lot of work to ensure that string interpolations are handled nicely
\ haxeRepeat,haxeBoolean,haxeConstant, syn match haxeErrorCharacter contained "\\\(x.\{0,2}\|u.\{0,4\}\|[^"'\\/nrt]\)"
\ haxeTypedef,haxeOperator,haxeType,haxeCoreType, syn match haxeSpecialCharacter contained "\\\(x[a-fA-F0-9]\{2\}\|[0-7]\{3\}\|["'\\/nrt]\)"
\ haxeStatement,haxeStorageClass,haxeAssert, syn match haxeIntSpecialChar contained "\$\@<!\(\$\$\)\+\(\(\$\$\)\+\)\@!"
\ haxeExceptions,haxeMethodDecl,haxeClassDecl, syn match haxeInterpolatedIdent contained "\((\$\$)\+\)\@<!\$[a-zA-Z_][a-zA-Z_0-9]*"
\ haxeClassDecl,haxeClassDecl,haxeScopeDecl, syn region haxeInterpolated contained start=+\(\$\(\$\$\)\+\)\@<!${+ end=+}+ contains=@Spell
\ haxeError,haxeError2,haxeUserLabel, syn region haxeDString start=+"+ end=+"+ contains=haxeSpecialCharacter,haxeErrorCharacter,@Spell
\ haxeLangObject,haxeFlashTop,haxeFlashInner, syn region haxeSString start=+'+ end=+'+ contains=haxeSpecialCharacter,haxeErrorCharacter,haxeIntSpecialChar,haxeInterpolatedIdent,haxeInterpolated,@Spell
\ haxeFlashFinal,haxeFlash9Final,haxeFunctionRef,
\ haxeComparison,haxeOptionalVars
" Comments " int/float/bool literal
syn keyword haxeTodo contained TODO FIXME XXX " ----------------------
if exists("haxe_comment_strings") syn match haxeInt "\<\([0-9]\+\|0x[0-9a-fA-F]\+\)\>"
syn region haxeCmString contained start=+"+ end=+"+ end=+$+ syn match haxeFloat "\<\([\-+]\?[0-9]*\.\?[0-9]\+([eE][\-+]\?[0-9]\+)\?\)\>"
\ end=+\*/+me=s-1,he=s-1 syn keyword haxeBool true false
\ contains=haxeSpecial,haxeCmStar,haxeSpecChr,@Spell
syn region haxeCm2String contained start=+"+ end=+$\|"+ " comments
\ contains=haxeSpecial,haxeSpecChr,@Spell " --------
syn match haxeCmCharacter contained "'\\[^']\{1,6\}'" contains=haxeSpecChr syn keyword haxeTODO contained TODO FIXME XXX
syn match haxeCmCharacter contained "'\\''" contains=haxeSpecChr syn match haxeComment "//.*" contains=haxeTODO,@Spell
syn match haxeCmCharacter contained "'[^\\]'" syn region haxeComment2 start=+/\*+ end=+\*/+ contains=haxeTODO,@Spell
syn cluster haxeCmSpecial add=haxeCmString,haxeCmCharacter,haxeNumber,haxeNumber2
syn cluster haxeCmSpecial2 add=haxeCm2String,haxeCmCharacter,haxeNumber,haxeNumber2 " preprocessing
endif " -------------
syn region haxeCm start="/\*" end="\*/" syn match haxePre "\(#if\|#elseif\|#else\|#end\)"
\ contains=@haxeCmSpecial,haxeTodo,@Spell syn match haxePreError "#error"
syn match haxeCmStar contained "^\s*\*[^/]"me=e-1
syn match haxeCmStar contained "^\s*\*$" " regex
syn match haxeLineCm "//.*" contains=@haxeCmSpecial2,haxeTodo,@Spell " -----
HaxeHiLink haxeCmString haxeDocTags syn region haxeRegex start=+\~\/+ end=+\/+ contains=haxeRegexEscape,haxeRegexError,@Spell
HaxeHiLink haxeCm2String haxeString
HaxeHiLink haxeCmCharacter haxeChr syn match haxeRegexError contained "\\[^0-9bdnrstwxBDSW(){}\[\]\\$^*\-+|./?]"
syn cluster haxeTop add=haxeCm,haxeLineCm syn match haxeRegexEscape contained "\\[0-9bdnrstwxBDSW(){}\[\]\\$^*\-+|./?]"
if exists("haxe_haxedoc") || main_syntax == 'jsp'
syntax case ignore " meta
" syntax coloring for haxedoc comments (HTML) " ----
" syntax include @haxeHtml <sfile>:p:h/html.vim syn match haxeMeta "@:\?[a-zA-Z_][a-zA-Z_0-9]*\>"
" unlet b:current_syntax
syn region haxeDocCm start="/\*\*" end="\*/" keepend syn match haxeCompilerMeta "@:\(
\ contains=haxeCmTitle,@haxeHtml,haxeDocTags,haxeTodo,@Spell,haxeProposedTags \abstract
syn region haxeCmTitle contained matchgroup=haxeDocCm start="/\*\*" \\|access
\ matchgroup=haxeCmTitle keepend end="\.$" \\|allow
\ end="\.[ \t\r<]"me=e-1 \\|annotation
\ end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 \\|arrayAccess
\ contains=@haxeHtml,haxeCmStar,haxeTodo,@Spell,haxeDocTags,haxeProposedTags \\|autoBuild
syn region haxeDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" \\|bind
\ end="}" \\|bitmap
syn match haxeDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" \\|build
\ contains=haxeDocParam \\|buildXml
syn match haxeDocParam contained "\s\S\+" \\|callable
syn match haxeDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>" \\|classCode
syn match haxeProposedTags contained "@\(category\|example\|tutorial\|index\|exclude\|todo\|internal\|obsolete\)\>" \\|commutative
syntax case match \\|compilerGenerated
endif \\|coreApi
syn match haxeCm "/\*\*/" " Edge case \\|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
\\)\>"
" Strings and constants syn sync ccomment haxeComment2 minlines=10
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 HaxeHiLink haxeMeta Macro
syn region haxeSingleString start=+'+ end=+'+ HaxeHiLink haxeCompilerMeta Identifier
syn match haxeChr "'[^']*'" contains=haxeSpecChr,haxeSpecChrError HaxeHiLink haxeRegex String
syn match haxeChr "'\\''" contains=haxeSpecChr HaxeHiLink haxeDString String
syn match haxeChr "'[^\\]'" HaxeHiLink haxeSString Character
syn match haxeNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" contains=haxeSpecNum HaxeHiLink haxeSpecialCharacter SpecialChar
"syn match haxeNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" HaxeHiLink haxeIntSpecialChar SpecialChar
syn match haxeNumber2 "\(\<\d\+\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" contains=haxeSpecNum HaxeHiLink haxeRegexEscape SpecialChar
syn match haxeNumber2 "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" contains=haxeSpecNum HaxeHiLink haxeErrorCharacter Error
syn match haxeNumber2 "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" contains=haxeSpecNum HaxeHiLink haxeRegexError Error
syn match haxeSpecNum contained "\(0[xX]\|[\.+-]\)" HaxeHiLink haxeInterpolatedIdent Normal
HaxeHiLink haxeInterpolated Normal
syn region haxeCondIf start="#if \+!\?" end="\(\W\|$\)" skip="([A-Za-z0-9_ |&!]\+)" HaxeHiLink haxeError Error
syn region haxeCondElseIf start="#elseif \+!\?" end="\(\W\|$\)" skip="([A-Za-z0-9_ |&!]\+)" HaxeHiLink haxeOperator Operator
syn match haxeCondElse "#else\s*$" HaxeHiLink haxeOperator2 Identifier
syn match haxeCondEnd "#end" HaxeHiLink haxeSpecial SpecialChar
syn match haxeCondError "#else .*$" HaxeHiLink haxeInt Number
HaxeHiLink haxeFloat Float
" unicode characters HaxeHiLink haxeBool Boolean
syn match haxeSpecial "\\u\d\{4\}" HaxeHiLink haxeComment Comment
HaxeHiLink haxeComment2 Comment
syn match haxeType ":[a-zA-Z_\.]\+" HaxeHiLink haxeTODO Todo
\ contains=haxeDelimiter,haxeCoreType,haxeFlashTop,haxeFlashInner,haxeFlashFinal,haxeFlash9Final HaxeHiLink haxePre PreCondit
HaxeHiLink haxePreError PreProc
syn cluster haxeTop add=haxeString,haxeChr,haxeNumber,haxeNumber2 HaxeHiLink haxeType Type
syn cluster haxeTop add=haxeSpecial,haxeStringError,haxeDelimiter,haxeType HaxeHiLink haxeTypedef Typedef
HaxeHiLink haxeTypeDecl Keyword " Structure just gives me same colour as Type and looks bad.
syn keyword haxeTraceFun trace contained HaxeHiLink haxeStorageClass StorageClass
syn region haxeTrace start=+\(^\s*\)\@<=trace(+ end=+);+ contains=haxeTraceFun HaxeHiLink haxeException Exception
HaxeHiLink haxeRepeat Repeat
if exists("haxe_highlight_functions") HaxeHiLink haxeLabel Label
if haxe_highlight_functions == "indent" HaxeHiLink haxeConditional Conditional
syn match haxeFuncDef "^\(\t\| \{4\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" HaxeHiLink haxeConstant Constant
\ contains=haxeType,haxeStorageClass,@haxeClasses HaxeHiLink haxeFunction Function
syn region haxeFuncDef start=+^\(\t\| \{4\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ HaxeHiLink haxeKeyword Keyword
\ 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 delcommand HaxeHiLink
let b:current_syntax = "haxe" let b:current_syntax = "haxe"
if main_syntax == 'haxe' let b:spell_options = "contained"
unlet main_syntax
endif
let b:spell_options="contained" " vim: ts=8

131
syntax/haxe_extended.vim Normal file
View File

@@ -0,0 +1,131 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'haxe', 'syntax/haxe_extended.vim')
finish
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Haxedoc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists("haxe_haxedoc") || (exists("main_syntax") && 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 haxeDocComment start="/\*\*" end="\*/" keepend contains=haxeCommentTitle,@haxeHtml,haxeDocTags,haxeTodo,@Spell
syn region haxeCommentTitle contained matchgroup=haxeDocComment start="/\*\*" matchgroup=haxeCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@haxeHtml,haxeCommentStar,haxeTodo,@Spell,haxeDocTags
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\)\>"
syntax case match
HaxeHiLink haxeDocComment Comment
HaxeHiLink haxeDocTags Special
HaxeHiLink haxeDocParam Function
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Haxe comment strings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists("haxe_comment_strings")
syn region haxeCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=haxeSpecial,haxeCommentStar,haxeSpecialChar,@Spell
syn region haxeComment2String contained start=+"+ end=+$\|"+ contains=haxeSpecial,haxeSpecialChar,@Spell
syn match haxeCommentCharacter contained "'\\[^']\{1,6\}'" contains=haxeSpecialChar
syn match haxeCommentCharacter contained "'\\''" contains=haxeSpecialChar
syn match haxeCommentCharacter contained "'[^\\]'"
syn cluster haxeCommentSpecial add=haxeCommentString,haxeCommentCharacter,haxeNumber
syn cluster haxeCommentSpecial2 add=haxeComment2String,haxeCommentCharacter,haxeNumber
HaxeHiLink haxeCommentString haxeString
HaxeHiLink haxeComment2String haxeString
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Haxe concealed text
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('g:haxe_conceal') && has("conceal")
syn match Ignore 'urn' transparent conceal containedin=haxeStatement
syn match Ignore 'ction' transparent conceal containedin=haxeStorageClass,haxeStatement
syn match Ignore 'ati' transparent conceal containedin=haxeStorageClass
syn match Ignore 'nline\|tati\|ubli' transparent conceal containedin=haxeScopeDecl
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Haxe space errors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists("haxe_space_errors")
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
HaxeHiLink haxeSpaceError Error
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Haxe minline comments
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if !exists("haxe_minlines")
let haxe_minlines = 10
exec "syn sync ccomment haxeComment minlines=" . haxe_minlines
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Mark braces in parens as errors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists("haxe_mark_braces_in_parens_as_errors")
syn match haxeInParen contained "[{}]"
HaxeHiLink haxeInParen haxeError
syn cluster haxeTop add=haxeInParen
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Highlight Functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists("haxe_highlight_functions")
if haxe_highlight_functions == "indent"
syn match haxeFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=haxeScopeDecl,haxeType,haxeStorageClass,@haxeClasses
syn region haxeFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=haxeScopeDecl,haxeType,haxeStorageClass,@haxeClasses
syn match haxeFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=haxeScopeDecl,haxeType,haxeStorageClass,@haxeClasses
syn region haxeFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=haxeScopeDecl,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\+\(\(public\|protected\|private\|static\|abstract\|override\|final\|native\|synchronized\)\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=haxeScopeDecl,haxeType,haxeStorageClass,haxeComment,haxeLineComment,@haxeClasses
endif
syn match haxeBraces "[{}]"
syn cluster haxeTop add=haxeFuncDef,haxeBraces
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Add special handling for haxecc.vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" use separate name so that it can be deleted in haxecc.vim
syn match haxeError2 "#\|=<"
HaxeHiLink haxeError2 haxeError
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Catch extra paren errors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" catch errors caused by wrong parenthesis
syn region haxeParenT transparent matchgroup=haxeParen start="(" end=")" contains=@haxeTop,haxeParenT1,haxeString,haxeSingleString
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" load a spearte haxeid.vim file
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if filereadable(expand("<sfile>:p:h")."/haxeid.vim")
source <sfile>:p:h/haxeid.vim
endif

115
syntax/hss.vim Normal file
View File

@@ -0,0 +1,115 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'haxe', 'syntax/hss.vim')
finish
endif
" Vim syntax file
" Language: hss (Haxe css)
" Author: Justin Donaldson (jdonaldson@gmail.com)
" Based heavily on work by Daniel Hofstetter (daniel.hofstetter@42dh.com)
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'hss'
endif
runtime! syntax/css.vim
runtime! syntax/css/*.vim
syn case ignore
syn region hssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,hssDefinition,hssComment,hssIdChar,hssClassChar,hssAmpersand,hssVariable,hssInclude,hssExtend,hssDebug,hssWarn,@hssControl,hssInterpolation,hssNestedSelector,hssReturn
syn region hssInterpolation start="#{" end="}" contains=hssVariable
syn match hssVariable "$[[:alnum:]_-]\+" nextgroup=hssVariableAssignment
syn match hssVariableAssignment ":" contained nextgroup=hssVariableValue
syn match hssVariableValue ".*;"me=e-1 contained contains=hssVariable,hssOperator,hssDefault "me=e-1 means that the last char of the pattern is not highlighted
" syn match hssMixin "^@mixin" nextgroup=hssMixinName
syn match hssMixinName " [[:alnum:]_-]\+" contained nextgroup=hssDefinition
syn match hssFunction "^@function" nextgroup=hssFunctionName
syn match hssFunctionName " [[:alnum:]_-]\+" contained nextgroup=hssDefinition
" syn match hssReturn "@return" contained
" syn match hssInclude "@include" nextgroup=hssMixinName
" syn match hssExtend "@extend .*[;}]"me=e-1 contains=cssTagName,hssIdChar,hssClassChar
syn keyword hssTodo TODO FIXME NOTE OPTIMIZE XXX contained containedIn=hssComment,cssComment
syn match hssColor "#[0-9A-Fa-f]\{3\}\>" contained
syn match hssColor "#[0-9A-Fa-f]\{6\}\>" contained
syn match hssIdChar "#[[:alnum:]_-]\@=" nextgroup=hssId contains=hssColor
syn match hssId "[[:alnum:]_-]\+" contained
syn match hssClassChar "\.[[:alnum:]_-]\@=" nextgroup=hssClass
syn match hssClass "[[:alnum:]_-]\+" contained
syn match hssAmpersand "&" nextgroup=cssPseudoClass
syn match hssOperator "+" contained
syn match hssOperator "-" contained
syn match hssOperator "/" contained
syn match hssOperator "*" contained
syn match hssNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,hssIdChar,hssClassChar,hssAmpersand,hssVariable,hssMixin,hssFunction,@hssControl,hssInterpolation,hssNestedProperty
syn match hssNestedProperty "[[:alnum:]]\+:"me=e-1 contained
" syn match hssDebug "@debug"
" syn match hssWarn "@warn"
syn match hssDefault "!default" contained
" syn match hssIf "@if"
" syn match hssElse "@else"
" syn match hssElseIf "@else if"
" syn match hssWhile "@while"
" syn match hssFor "@for" nextgroup=hssVariable
" syn match hssFrom " from "
" syn match hssTo " to "
" syn match hssThrough " through "
" syn match hssEach "@each" nextgroup=hssVariable
" syn match hssIn " in "
" syn cluster hssControl contains=hssIf,hssElse,hssElseIf,hssWhile,hssFor,hssFrom,hssTo,hssThrough,hssEach,hssIn
syn match hssComment "//.*$" contains=@Spell
syn region hssImportStr start="\"" end="\""
syn region hssImport start="@import" end=";" contains=hssImportStr,hssComment,cssComment,cssUnicodeEscape,cssMediaType
hi def link hssVariable Identifier
hi def link hssVariableValue Constant
hi def link hssMixin PreProc
hi def link hssMixinName Function
hi def link hssFunction PreProc
hi def link hssFunctionName Function
hi def link hssReturn Statement
hi def link hssInclude PreProc
hi def link hssExtend PreProc
hi def link hssComment Comment
hi def link hssColor Constant
hi def link hssIdChar Special
hi def link hssClassChar Special
hi def link hssId Identifier
hi def link hssClass Identifier
hi def link hssAmpersand Character
hi def link hssNestedProperty Type
hi def link hssDebug Debug
hi def link hssWarn Debug
hi def link hssDefault Special
hi def link hssIf Conditional
hi def link hssElse Conditional
hi def link hssElseIf Conditional
hi def link hssWhile Repeat
hi def link hssFor Repeat
hi def link hssFrom Repeat
hi def link hssTo Repeat
hi def link hssThrough Repeat
hi def link hssEach Repeat
hi def link hssIn Repeat
hi def link hssInterpolation Delimiter
hi def link hssImport Include
hi def link hssImportStr Include
hi def link hssTodo Todo
let b:current_syntax = "hss"
if main_syntax == 'hss'
unlet main_syntax
endif

90
syntax/hxml.vim Normal file
View File

@@ -0,0 +1,90 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'haxe', 'syntax/hxml.vim')
finish
endif
" Vim syntax file
" Author : Justin Donaldson (jdonaldson@gmail.com)
" Based extensively on a version by Ganesh Gunasegaran(me at itsgg.com)
" Language : hxml
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax='hxml'
endif
" Simple TODO/comment handling
syntax keyword hxmlTodo contained TODO FIXME XXX NOTE
syntax match hxmlComment "#.*$" contains=hxmlTodo
" basic flags
syntax match hxmlType "-v"
syntax match hxmlType "-x"
syntax match hxmlType "-D"
"target/config flags
syntax match hxmlType "--\?as3"
syntax match hxmlType "--\?cmd"
syntax match hxmlType "--\?cp"
syntax match hxmlType "--\?cpp"
syntax match hxmlType "--\?cppia"
syntax match hxmlType "--\?java"
syntax match hxmlType "--\?cs"
syntax match hxmlType "--\?debug"
syntax match hxmlType "--\?help"
syntax match hxmlType "--\?js"
syntax match hxmlType "--\?lib"
syntax match hxmlType "--\?lua"
syntax match hxmlType "--\?main"
syntax match hxmlType "--\?neko"
syntax match hxmlType "--\?php"
syntax match hxmlType "--\?python"
syntax match hxmlType "--\?prompt"
syntax match hxmlType "--\?resource"
syntax match hxmlType "--\?swf"
syntax match hxmlType "--\?swf-header"
syntax match hxmlType "--\?swf-lib"
syntax match hxmlType "--\?swf-version"
syntax match hxmlType "--\?swf9"
syntax match hxmlType "--\?xml"
" haxe 3.0 flags
syntax match hxmlType "--/?dce"
syntax match hxmlType "--/?swf-lib-extern"
syntax match hxmlType "--/?version"
syntax match hxmlType "--/?help-metas"
syntax match hxmlType "--/?help-defines"
" advanced flags
syntax match hxmlStatement "--connect"
syntax match hxmlStatement "--cwd"
syntax match hxmlStatement "--dead-code-elimination"
syntax match hxmlStatement "--display"
syntax match hxmlStatement "--flash-strict"
syntax match hxmlStatement "--flash-use-stage"
syntax match hxmlStatement "--gen-hx-classes"
syntax match hxmlStatement "--help"
syntax match hxmlStatement "--interp"
syntax match hxmlStatement "--js-modern"
syntax match hxmlStatement "--macro"
syntax match hxmlStatement "--next"
syntax match hxmlStatement "--no-inline"
syntax match hxmlStatement "--no-opt"
syntax match hxmlStatement "--no-output"
syntax match hxmlStatement "--no-traces"
syntax match hxmlStatement "--php-front"
syntax match hxmlStatement "--php-lib"
syntax match hxmlStatement "--php-prefix"
syntax match hxmlStatement "--remap"
syntax match hxmlStatement "--times"
syntax match hxmlStatement "--wait"
" Highlight them
highlight link hxmlType Type
highlight link hxmlStatement Statement
highlight link hxmlComment Comment
highlight link hxmlTodo Todo

View File

@@ -117,6 +117,8 @@ call TestFiletype('html.handlebars')
call TestFiletype('haproxy') call TestFiletype('haproxy')
call TestFiletype('haskell') call TestFiletype('haskell')
call TestFiletype('haxe') call TestFiletype('haxe')
call TestFiletype('hxml')
call TestFiletype('hss')
call TestFiletype('hcl') call TestFiletype('hcl')
call TestFiletype('hive') call TestFiletype('hive')
call TestFiletype('i3config') call TestFiletype('i3config')