summaryrefslogtreecommitdiff
path: root/.vim/syntax/cobra.vim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.vim/syntax/cobra.vim169
1 files changed, 169 insertions, 0 deletions
diff --git a/.vim/syntax/cobra.vim b/.vim/syntax/cobra.vim
new file mode 100644
index 0000000..b84158e
--- /dev/null
+++ b/.vim/syntax/cobra.vim
@@ -0,0 +1,169 @@
+" Vim syntax file
+" Language: Cobra
+" Maintainer:
+" Updated: 2008-10-11
+"
+"
+" Options to control Cobra syntax highlighting:
+"
+" For highlighted numbers:
+"
+" let cobra_highlight_numbers = 1
+"
+" For highlighted builtin functions:
+"
+" let cobra_highlight_builtins = 1
+"
+" For highlighted standard exceptions:
+"
+" let cobra_highlight_exceptions = 1
+"
+" Highlight erroneous whitespace:
+"
+" let cobra_highlight_space_errors = 1
+"
+" If you want all possible Cobra highlighting (the same as setting the
+" preceding options):
+"
+" let cobra_highlight_all = 1
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword cobraStatement abstract all any as
+syn keyword cobraStatement assembly assert base be body
+syn keyword cobraStatement bool branch break callable catch
+syn keyword cobraStatement char class continue ct_trace cue
+syn keyword cobraStatement decimal def Dictionary dynamic
+syn keyword cobraStatement ensure enum event expect extend
+syn keyword cobraStatement extern fake false finally float
+syn keyword cobraStatement float32 float64 get
+syn keyword cobraStatement has ignore implements implies
+syn keyword cobraStatement inherits init inlined inout
+syn keyword cobraStatement int int16 int32 int64 int8
+syn keyword cobraStatement interface internal invariant List
+syn keyword cobraStatement listen must namespace new nil
+syn keyword cobraStatement nonvirtual number of off
+syn keyword cobraStatement old on out override
+syn keyword cobraStatement partial pass passthrough print
+syn keyword cobraStatement private pro protected public raise
+syn keyword cobraStatement ref require result return set
+syn keyword cobraStatement Set shared sig stop String
+syn keyword cobraStatement struct success test this throw
+syn keyword cobraStatement to to? trace true try
+syn keyword cobraStatement Type uint uint16 uint32 uint64
+syn keyword cobraStatement uint8 using value var
+syn keyword cobraStatement vari virtual where yield
+
+syn match cobraFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained
+syn keyword cobraRepeat for while post
+syn keyword cobraConditional if else
+syn keyword cobraOperator and in is not or
+syn keyword cobraPreCondit use from import
+syn match cobraComment "#.*$" contains=cobraTodo,@Spell
+syn keyword cobraTodo TODO FIXME XXX contained
+
+" strings
+syn region cobraString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=cobraEscape,@Spell
+syn region cobraString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=cobraEscape,@Spell
+syn region cobraString matchgroup=Normal start=+[uU]\="""+ end=+"""+ contains=cobraEscape,@Spell
+syn region cobraString matchgroup=Normal start=+[uU]\='''+ end=+'''+ contains=cobraEscape,@Spell
+syn region cobraRawString matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+ contains=@Spell
+syn region cobraRawString matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+ contains=@Spell
+syn region cobraRawString matchgroup=Normal start=+[uU]\=[rR]"""+ end=+"""+ contains=@Spell
+syn region cobraRawString matchgroup=Normal start=+[uU]\=[rR]'''+ end=+'''+ contains=@Spell
+syn match cobraEscape +\\[abfnrtv'"\\]+ contained
+syn match cobraEscape "\\\o\{1,3}" contained
+syn match cobraEscape "\\x\x\{2}" contained
+syn match cobraEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained
+syn match cobraEscape "\\$"
+
+if exists("cobra_highlight_all")
+ let cobra_highlight_numbers = 1
+ let cobra_highlight_builtins = 1
+ let cobra_highlight_exceptions = 1
+ let cobra_highlight_space_errors = 1
+endif
+
+if exists("cobra_highlight_numbers")
+ " numbers (including longs and complex)
+ syn match cobraNumber "\<0x\x\+[Ll]\=\>"
+ syn match cobraNumber "\<\d\+[LljJ]\=\>"
+ syn match cobraNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
+ syn match cobraNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>"
+ syn match cobraNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
+endif
+
+if exists("cobra_highlight_builtins")
+ " builtin functions, types and objects, not really part of the syntax
+ syn keyword cobraBuiltin True False bool
+endif
+
+if exists("cobra_highlight_exceptions")
+ " builtin exceptions and warnings
+ syn keyword cobraException Exception
+endif
+
+if exists("cobra_highlight_space_errors")
+ " trailing whitespace
+ syn match cobraSpaceError display excludenl "\S\s\+$"ms=s+1
+ " mixed tabs and spaces
+ syn match cobraSpaceError display " \+\t"
+ syn match cobraSpaceError display "\t\+ "
+endif
+
+" This is fast but code inside triple quoted strings screws it up. It
+" is impossible to fix because the only way to know if you are inside a
+" triple quoted string is to start from the beginning of the file. If
+" you have a fast machine you can try uncommenting the "sync minlines"
+" and commenting out the rest.
+syn sync match cobraSync grouphere NONE "):$"
+syn sync maxlines=200
+"syn sync minlines=2000
+
+if version >= 508 || !exists("did_cobra_syn_inits")
+ if version <= 508
+ let did_cobra_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink cobraStatement Statement
+ HiLink cobraFunction Function
+ HiLink cobraConditional Conditional
+ HiLink cobraRepeat Repeat
+ HiLink cobraString String
+ HiLink cobraRawString String
+ HiLink cobraEscape Special
+ HiLink cobraOperator Operator
+ HiLink cobraPreCondit PreCondit
+ HiLink cobraComment Comment
+ HiLink cobraTodo Todo
+ HiLink cobraDecorator Define
+ if exists("cobra_highlight_numbers")
+ HiLink cobraNumber Number
+ endif
+ if exists("cobra_highlight_builtins")
+ HiLink cobraBuiltin Function
+ endif
+ if exists("cobra_highlight_exceptions")
+ HiLink cobraException Exception
+ endif
+ if exists("cobra_highlight_space_errors")
+ HiLink cobraSpaceError Error
+ endif
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cobra"
+
+" vim: ts=8