ats-vim/syntax/ats.vim

106 lines
3.5 KiB
VimL
Raw Normal View History

2018-02-26 18:55:36 -05:00
scriptencoding utf-8
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
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
2020-02-11 00:06:06 -05:00
syn match atsFloat "\v[0-9]+\.[0-9]+f"
syn match atsDouble "\v[0-9]+\.[0-9]+"
2018-02-26 18:27:42 -05:00
syn match atsInt "\v[0-9]+"
2018-03-05 09:14:08 -05:00
syn match atsUint "\v[0-9]+u"
2018-05-13 21:56:05 -04:00
syn match atsHex "\v0x[0-9a-fA-F]+"
2018-02-26 18:27:42 -05:00
2019-10-20 21:22:49 -04:00
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 20:46:25 -05:00
syn keyword atsKeyword staload dynload overload with fun symintr include fn fnx and prfun prfn praxi castfn sortdef
2018-08-11 21:57:59 -04:00
syn keyword atsKeyword as lam llam fix raise of var val prval if then else addr let in begin end when where local while for prvar sif
2018-07-23 22:39:47 -04:00
syn keyword atsKeywordTwo case ifcase scase
2018-09-01 14:43:56 -04:00
syn keyword atsKeyword stadef sta stacst assume macdef exception rec
2018-02-26 18:27:42 -05:00
2018-02-26 18:53:22 -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
2018-03-23 15:07:27 -04:00
syn match atsArrow '=/=>'
2018-08-05 01:06:45 -04:00
syn match atsArrow '=/=>>'
2018-02-26 18:40:25 -05:00
syn region atsArrow start="=<" end=">" contains=arrowContents
2018-02-26 20:46:25 -05:00
syn region atsArrow start="-<" end=">"
2018-02-26 18:40:25 -05:00
2020-09-04 17:15:38 -04:00
syn keyword atsType void bool string char int uint uint8 uint32 uint64 uint16 int8 int32 int16 int64 charNZ strnptr Strptr0 Strptr1 nat lint ulint double float size_t llint ullint
2018-08-11 20:13:53 -04:00
syn keyword atsType datavtype datatype vtypedef dataviewtype viewtypdef typedef view viewdef dataview abstype absvtype absviewtype absview datasort dataprop type viewtype vtype propdef prop
2018-07-17 16:11:47 -04:00
syn keyword atsType absimpl absprop
2018-02-26 18:27:42 -05:00
syn keyword atsType implement primplmnt extern
2018-02-26 18:40:25 -05:00
syn match atsParens "[()]"
2018-02-26 23:59:50 -05:00
syn match atsOperator "\v[\@\'\#]"
2018-02-26 18:27:42 -05:00
2018-02-26 23:57:57 -05:00
syn region atsMacro start="\v^#" end="\v$" contains=atsString
2018-02-26 18:27:42 -05:00
2018-02-26 18:53:22 -05:00
syn keyword atsBool true false
2018-02-28 15:40:02 -05:00
syn match atsComment "\v\/\/.*$" contains=atsTodo,@Spell
2018-02-28 20:50:06 -05:00
syn region atsNestComment start="/\*" end="\*/" contains=atsNestComment,atsTodo,@Spell
syn region atsNestParenComment start="(\*" end="\*)" contains=atsTodo,@Spell,atsNestParenComment
2018-02-26 19:07:18 -05:00
2020-03-03 17:02:24 -05:00
syntax match atsType 'absvt@ype' contains=atsOperator
syntax match atsType 'vt@ype' contains=atsOperator
syntax match atsType 'abst@ype' contains=atsOperator
syntax match atsType 't@ype' contains=atsOperator
2020-03-03 17:00:25 -05:00
2018-02-26 19:09:03 -05:00
syntax match logicalAnd '&&' conceal cchar=
syntax match leq '<=' conceal cchar=
syntax match geq '>=' conceal cchar=
syntax match neq '!=' conceal cchar=
2018-06-18 03:42:46 -04:00
syntax match seq '==' conceal cchar=
2018-02-26 19:09:03 -05:00
syntax match logicalOr '||' conceal cchar=
2018-08-05 01:06:45 -04:00
syntax match nullPtr 'null' conceal cchar=
2018-02-26 19:09:03 -05:00
2018-03-03 16:53:30 -05:00
syn match atsChar "\v'.'"
syn match atsChar "\v'.*'" contains=atsSpecial
2018-04-27 00:09:28 -04:00
syn match atsPattern "\v'\("
2018-03-03 16:53:30 -05:00
2018-02-26 19:09:03 -05:00
syn include @c syntax/c.vim
2018-04-09 21:59:39 -04:00
syn region cBlock matchgroup=atsCBlock start="%{\|%{^\|%{#" end="%}" contains=@c
2018-02-26 19:09:03 -05:00
highlight link Conceal Keyword
2018-02-26 18:53:22 -05:00
highlight link atsBool Boolean
2018-02-26 18:48:54 -05:00
highlight link atsKeywordTwo 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
2018-05-13 21:52:33 -04:00
highlight link atsHex Number
2020-02-11 00:04:04 -05:00
highlight link atsFloat Number
highlight link atsDouble Number
2018-02-26 18:27:42 -05:00
highlight link atsChar Character
2018-02-26 18:11:07 -05:00
highlight link atsComment Comment
highlight link atsNestComment Comment
2018-02-28 20:50:06 -05:00
highlight link atsNestParenComment Comment
2018-02-26 18:11:07 -05:00
highlight link atsKeyword Keyword
highlight link atsType Type
2022-10-06 11:21:54 -04:00
highlight link atsIdentifier Normal
2009-06-26 20:00:00 -04:00
2018-02-26 18:55:36 -05:00
hi def link atsCBlock Special
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