github.com/mattn/anko@v0.1.10/misc/vim/syntax/anko.vim (about) 1 if exists("b:current_syntax") 2 finish 3 endif 4 5 syn case match 6 7 syn keyword ankoDirective module 8 syn keyword ankoDeclaration var 9 10 hi def link ankoDirective Statement 11 hi def link ankoDeclaration Type 12 13 syn keyword ankoStatement return break continue throw 14 syn keyword ankoConditional if else switch try catch finally 15 syn keyword ankoLabel case default 16 syn keyword ankoRepeat for range 17 18 hi def link ankoStatement Statement 19 hi def link ankoConditional Conditional 20 hi def link ankoLabel Label 21 hi def link ankoRepeat Repeat 22 23 syn match ankoDeclaration /\<func\>/ 24 syn match ankoDeclaration /^func\>/ 25 26 syn keyword ankoCast bytes runes string 27 28 hi def link ankoCast Type 29 30 syn keyword ankoBuiltins keys len 31 syn keyword ankoBuiltins println printf print 32 syn keyword ankoConstants true false nil 33 34 hi def link ankoBuiltins Keyword 35 hi def link ankoConstants Keyword 36 37 " Comments; their contents 38 syn keyword ankoTodo contained TODO FIXME XXX BUG 39 syn cluster ankoCommentGroup contains=ankoTodo 40 syn region ankoComment start="#" end="$" contains=@ankoCommentGroup,@Spell 41 42 hi def link ankoComment Comment 43 hi def link ankoTodo Todo 44 45 " anko escapes 46 syn match ankoEscapeOctal display contained "\\[0-7]\{3}" 47 syn match ankoEscapeC display contained +\\[abfnrtv\\'"]+ 48 syn match ankoEscapeX display contained "\\x\x\{2}" 49 syn match ankoEscapeU display contained "\\u\x\{4}" 50 syn match ankoEscapeBigU display contained "\\U\x\{8}" 51 syn match ankoEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ 52 53 hi def link ankoEscapeOctal ankoSpecialString 54 hi def link ankoEscapeC ankoSpecialString 55 hi def link ankoEscapeX ankoSpecialString 56 hi def link ankoEscapeU ankoSpecialString 57 hi def link ankoEscapeBigU ankoSpecialString 58 hi def link ankoSpecialString Special 59 hi def link ankoEscapeError Error 60 61 " Strings and their contents 62 syn cluster ankoStringGroup contains=ankoEscapeOctal,ankoEscapeC,ankoEscapeX,ankoEscapeU,ankoEscapeBigU,ankoEscapeError 63 syn region ankoString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@ankoStringGroup 64 syn region ankoRawString start=+`+ end=+`+ 65 66 hi def link ankoString String 67 hi def link ankoRawString String 68 69 " Characters; their contents 70 syn cluster ankoCharacterGroup contains=ankoEscapeOctal,ankoEscapeC,ankoEscapeX,ankoEscapeU,ankoEscapeBigU 71 syn region ankoCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@ankoCharacterGroup 72 73 hi def link ankoCharacter Character 74 75 " Regions 76 syn region ankoBlock start="{" end="}" transparent fold 77 syn region ankoParen start='(' end=')' transparent 78 79 " Integers 80 syn match ankoDecimalInt "\<\d\+\([Ee]\d\+\)\?\>" 81 syn match ankoHexadecimalInt "\<0x\x\+\>" 82 syn match ankoOctalInt "\<0\o\+\>" 83 syn match ankoOctalError "\<0\o*[89]\d*\>" 84 85 hi def link ankoDecimalInt Integer 86 hi def link ankoHexadecimalInt Integer 87 hi def link ankoOctalInt Integer 88 hi def link Integer Number 89 90 " Floating point 91 syn match ankoFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" 92 syn match ankoFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>" 93 syn match ankoFloat "\<\d\+[Ee][-+]\d\+\>" 94 95 hi def link ankoFloat Float 96 hi def link ankoImaginary Number 97 98 syn sync minlines=500 99 100 let b:current_syntax = "anko"