ats-vim/syntax/ats.vim

69 lines
1.9 KiB
VimL
Raw Normal View History

2017-11-05 11:41:12 -05:00
if !exists('main_syntax')
if exists('b:current_syntax')
2009-06-26 20:00:00 -04:00
finish
endif
let main_syntax = 'ats'
endif
2018-02-26 18:11:07 -05:00
syn keyword atsTodo TODO FIXME contained
syn match atsComment "\v\/\/.*$"
syn region atsNestComment start="(\*" end="\*)" contains=atsNestComment,atsTodo,@Spell
2009-06-26 20:00:00 -04:00
2018-02-26 18:27:42 -05:00
syn match atsIdentifier "\v[a-zA-Z][a-zA-Z_0-9]*"
2009-06-26 20:00:00 -04:00
2018-02-26 18:27:42 -05:00
syn match atsChar "\v'.'"
2009-06-26 20:00:00 -04:00
2018-02-26 18:27:42 -05:00
syn match atsUint "\v[0-9]+u"
syn match atsInt "\v[0-9]+"
syn match atsSpecial +\v\\["nt]+
2018-02-26 18:40:25 -05:00
syn match atsSpecial -\v\\[0-9]+-
2018-02-26 18:27:42 -05:00
syn region atsString start=+"+ end=+"+ contains=atsSpecial
2018-02-26 18:40:25 -05:00
syn keyword atsKeyword staload dynload overload with fun symintr include fn fnx and prfun prfn
2018-02-26 18:48:54 -05:00
syn keyword atsKeyword lam llam fix raise of var val prval
syn keyword atsKeywordTwo case ifcase if then else
syn region atsQualName start="\$" end="\." contains=atsIdentifier
2018-02-26 18:27:42 -05:00
2018-02-26 18:40:25 -05:00
syn match atsKeyword "\v[\%\+\-\<\>\=!]+"
2018-02-26 18:27:42 -05:00
syn keyword atsFixity infixr infixl prefix postfix
2018-02-26 18:40:25 -05:00
syn keyword arrowContents cloref1 cloptr1 lincloptr cloref cloptr
syn region atsArrow start="=<" end=">" contains=arrowContents
2018-02-26 18:27:42 -05:00
syn keyword atsType void bool string char int uint charNZ strnptr Strptr0 Strptr1 nat
syn keyword atsType datavtype datatype vtypedef dataviewtype viewtypdef typedef
syn keyword atsType implement primplmnt extern
2018-02-26 18:40:25 -05:00
syn match atsParens "[()]"
2018-02-26 18:48:54 -05:00
syn match atsOperator "\v\@"
2018-02-26 18:27:42 -05:00
syn match atsMacro "\v\#.*$"
2018-02-26 18:48:54 -05:00
highlight link atsKeywordTwo Include
highlight link atsQualName Include
2018-02-26 18:40:25 -05:00
highlight link atsArrow Special
2018-02-26 18:27:42 -05:00
highlight link atsFixity Underlined
2018-02-26 18:40:25 -05:00
highlight link atsOperator Special
2018-02-26 18:27:42 -05:00
highlight link atsSpecial Special
highlight link atsString String
highlight link atsUint Number
highlight link atsInt Number
highlight link atsChar Character
2018-02-26 18:11:07 -05:00
highlight link atsComment Comment
highlight link atsNestComment Comment
highlight link atsKeyword Keyword
highlight link atsType Type
2018-02-26 18:27:42 -05:00
highlight link atsIdentifier Identifier
2009-06-26 20:00:00 -04:00
2017-11-05 11:41:12 -05:00
let b:current_syntax = 'ats'
2009-06-26 20:00:00 -04:00
2017-11-05 11:41:12 -05:00
if main_syntax ==# 'ats'
2009-06-26 20:00:00 -04:00
unlet main_syntax
endif