diff options
Diffstat (limited to '.vim/syntax')
-rw-r--r-- | .vim/syntax/fortress.vim | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/.vim/syntax/fortress.vim b/.vim/syntax/fortress.vim new file mode 100644 index 0000000..13aacbb --- /dev/null +++ b/.vim/syntax/fortress.vim @@ -0,0 +1,90 @@ +" Vim syntax file +" Language: Fortress +" Filenames: *.fsi *.fss +" Maintainers: Jon Rafkind <rafkind@cs.utah.edu> +" URL: http://www.cs.utah.edu/~rafkind +" Last Change: 2008 May 20 - Initial version + +" Some stuff stolen from ocaml.vim + +if version < 600 + syntax clear +elseif exists("b:current_syntax") && b:current_syntax == "fortress" + finish +endif + +" syn region fortressComment start="(\*)" end="\\$" end="$" +syn region fortressComment start="(\*" end="\*)" contains=fortressComment +syn match fortressLineComment "(\*).*" +syn match fortressEnd "\<end\>" + +" syn match fortressKeyword "\<getter\>" +syn keyword fortressKeyword getter else var test +syn keyword fortressExternal import export + +syn region fortressString start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match fortressChar "'.'" +syn match fortressNumber "\<-\=\d\(_\|\d\)*" + +syn keyword fortressType api object trait value +syn keyword fortressType extends abstract comprises +syn keyword fortressType grammar component +syn keyword fortressType Any Boolean String self +syn keyword fortressType Char +syn keyword fortressType ZZ32 ZZ64 RR32 RR64 ZZ + +syn keyword fortressOperator println + +syn keyword fortressKeyword opr for private asif throw + +syn match fortressThenErr "\<then\>" +syn match fortressCaseErr "\<case\>" +syn match fortressCatchErr "\<catch\>" +syn match fortressTypecaseErr "\<of\>" + +syn region fortressNone matchgroup=fortressKeyword start="\<if\>" matchgroup=fortressKeyword end="\<then\>" contains=ALLBUT,fortressThenErr nextgroup=fortressIf +syn region fortressIf matchgroup=fortressKeyword start="\<elif\>" matchgroup=fortressKeyword end="\<then\>" contains=ALLBUT,fortressThenErr nextgroup=fortressIf +syn region fortressIf matchgroup=fortressKeyword start="\<then\>" matchgroup=fortressKeyword end="\<end\>" contains=ALLBUT,fortressThenErr + +syn region fortressNone matchgroup=fortressKeyword start="\<case\>" matchgroup=fortressKeyword end="\<of\>" contains=ALLBUT,fortressCaseErr nextgroup=fortressCase +syn region fortressCase matchgroup=fortressKeyword start="\<in\>" matchgroup=fortressKeyword end="\<end\>" contains=ALLBUT,fortressCaseErr + +syn region fortressNone matchgroup=fortressKeyword start="\<typecase\>" matchgroup=fortressKeyword end="\<of\>" contains=ALLBUT,fortressTypecaseErr nextgroup=fortressTypecase +syn region fortressTypecase matchgroup=fortressKeyword start="\<of\>" matchgroup=fortressKeyword end="\<end\>" contains=ALLBUT,fortressEndErr + +syn region fortressNone matchgroup=fortressKeyword start="\<try\>" matchgroup=fortressKeyword end="\<catch\>" contains=ALLBUT,fortressCatchErr nextgroup=fortressCatch +syn region fortressCatch matchgroup=fortressKeyword start="\<catch\>" matchgroup=fortressKeyword end="\<end\>" contains=ALLBUT,fortressEndErr + +syn region fortressNone matchgroup=fortressKeyword start="\<do\>" matchgroup=fortressKeyword end="\<end\>" contains=ALLBUT,fortressEndErr + +syn region fortressApi matchgroup=fortressModule start="\<api\>" matchgroup=fortressModule end="\<end\>" contains=ALLBUT,fortressEndErr +syn region fortressObject matchgroup=fortressModule start="\<object\>" matchgroup=fortressModule end="\<end\>" contains=ALLBUT,fortressEndErr +syn region fortressTrait matchgroup=fortressModule start="\<trait\>" matchgroup=fortressModule end="\<end\>" contains=ALLBUT,fortressEndErr +syn region fortressComponent matchgroup=fortressModule start="\<component\>" matchgroup=fortressModule end="\<end\>" contains=ALLBUT,fortressEndErr + +if version >= 508 || !exists("did_fortress_syntax_inits") + if version < 508 + let did_fortress_syntax_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink fortressComment Comment + HiLink fortressLineComment Comment + HiLink fortressKeyword Keyword + HiLink fortressExternal Include + HiLink fortressType Type + HiLink fortressOperator Operator + HiLink fortressEnd Statement + + HiLink fortressString String + HiLink fortressChar String + HiLink fortressNumber Number + + HiLink fortressThenErr Error + + delcommand HiLink +endif + +let b:current_syntax = "fortress" |