Created
September 18, 2014 06:56
-
-
Save relekang/7b90b7e94e99da2ef8f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: Bailey.js | |
" Maintainer: Rolf Erik Lekang | |
" URL: https://github.com/relekang/vim-baileyjs | |
if exists("b:current_syntax") | |
finish | |
endif | |
syn keyword bsInclude import export | |
syn keyword bsOperator and in is not or | |
syn keyword bsKeyword new | |
syn keyword bsBoolean true false | |
syn keyword bsStructure null undefined | |
syn keyword bsStatement return | |
syn keyword bsStatement class nextgroup=bsClass skipwhite | |
syn keyword bsConditional if elif else | |
syn keyword bsRepeat for while | |
syn keyword bsNumber NaN Infinity | |
syn keyword bsException try catch finally | |
syn match bsImportEscape /[\/\.\,\:]/ display contained | |
syn match bsImportAs / as / display contained | |
syn match bsImportType /[a-zA-Z]+/ | |
syn match bsNumber "\<\d[lL]\=\>" display | |
syn match bsNumber "\<[0-9]\d\+[lL]\=\>" display | |
syn match bsNumber "\<\d\+[lLjJ]\>" display | |
syn match bsComment "#.*$" display | |
syn match bsError "[=!]==" display | |
syn match bsOperator "[!<>=]=" display | |
syn match bsOperator "([^\(\)]*) ->" display | |
syn match bsEscape "#{[^}]+}" display contained | |
syn match bsClass "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained | |
syn match bsObjectError /,/ contained | |
syn region bsImportVariables start="import" end=/$/ contains=bsImportEscape,bsImportAs,bsImportType | |
syn region bsString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@spell | |
syn region bsString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@spell | |
syn region bsCurlies matchgroup=bsCurly start=/{/ end=/}/ contains=@bsAll | |
syn region bsBrackets matchgroup=bsBracket start=/\[/ end=/\]/ contains=@bsAll | |
syn region bsParens matchgroup=bsParen start=/(/ end=/)/ contains=@bsAll | |
syn region bsInterpolation matchgroup=bsInterpDelim start=/#{/ end=/}/ contained contains=@bsAll | |
syn cluster bsAll contains=bsInclude,bsImportAs,bsImportType,bsOperator,bsConditional,bsObject,bsFunction,bsClass,bsRepeat,bsStructure,bsBoolean,bsFloat,bsNumber,bsComment,bsString,bsException,bsImportEscape,bsIndentError,bsObjectError,bsError | |
syn cluster bsInterpString contains=bsInterpolation | |
hi def link bsInclude Include | |
hi def link bsImportAs Include | |
hi def link bsImportType Type | |
hi def link bsOperator Operator | |
hi def link bsConditional Conditional | |
hi def link bsObject Statement | |
hi def link bsFunction Function | |
hi def link bsClass Function | |
hi def link bsRepeat Repeat | |
hi def link bsStructure Structure | |
hi def link bsBoolean Boolean | |
hi def link bsFloat Float | |
hi def link bsNumber Number | |
hi def link bsComment Comment | |
hi def link bsString String | |
hi def link bsException Exception | |
hi def link bsImportEscape Comment | |
hi def link bsInterpDelim PreProc | |
hi def link bsIndentError Error | |
hi def link bsObjectError Error | |
hi def link bsError Error | |
let b:current_syntax = "bailey" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment