maude-vim/syntax/maude.vim

104 lines
2.5 KiB
VimL

" Maude syntax file.
if exists('b:current_syntax')
finish
endif
let b:current_syntax = 'maude'
" also most other things...
setlocal iskeyword+=-
setlocal commentstring=***%s comments=b:***,b:---
syn keyword maudeMod mod endm th endth
hi def link maudeMod Structure
syn keyword maudeFMod fmod endfm fth endfth smod endsm is
hi def link maudeFMod maudeMod
syn keyword maudeSMod smod endsm sth endsth
hi def link maudeSMod maudeMod
syn keyword maudeView view from to endv
hi def link maudeView maudeMod
syn keyword maudeIs is
hi def link maudeIs maudeMod
syn keyword maudeImport protecting pr including inc extending ex
hi def link maudeImport Include
syn keyword maudeSort sort sorts subsort subsorts
hi def link maudeSort StorageClass
syn keyword maudeOp op ops
hi def link maudeOp Constant
syn keyword maudeVar var vars
hi def link maudeVar Identifier
syn keyword maudeEq eq ceq
hi def link maudeEq Function
syn keyword maudeRl rl crl
hi def link maudeRl maudeEq
syn keyword maudeMb mb cmb
hi def link maudeMb maudeEq
syn keyword maudeStrat strat strats
hi def link maudeStrat Repeat
syn keyword maudeSd sd csd
hi def link maudeSd maudeEq
syn keyword maudeIf if
syn match maudeIf '/\\'
hi def link maudeIf Conditional
syn match maudeUnderscore '_'
hi def link maudeUnderscore Special
syn match maudePunc
\ '\%(^\|\s\)\zs\%(:[:=]\?\|->\|<-\|=>\|=\%(=\|/=\)\?\|@\)\ze\%(\s\|$\)'
hi def link maudePunc Operator
syn match maudeDelim '[{}\[\](),]\|\%(^\|\s\)\zs\.\ze\%(\s\|$\)'
hi def link maudeDelim Delimiter
syn match maudeString /"\%([^"\\]\|\\.\)*"/ contains=maudeStringEsc
hi def link maudeString String
syn match maudeStringEsc /\\./ contained
hi def link maudeStringEsc SpecialChar
syn match maudeIdEsc /`[\[\]{}()]\?/
hi def link maudeIdEsc SpecialChar
syn match maudeQid /''\?\S\+/
syn match maudeQid /'"\%([^"\\]\|\\.\)*"/ contains=maudeStringEsc
hi def link maudeQid Constant
syn match maudeNum !\%(^\|\s\)\zs-\?\d\+\%(/\d\+\)\?\ze\%(\s\|$\)!
syn match maudeNum /\%(^\|\s\)\zs-\?\d\+\.\d\+\%([Ee][+-]\?\d\+\)\?\ze\%(\s\|$\)/
syn keyword maudeNum Infinity -Infinity
hi def link maudeNum Number
syn keyword maudeCommand load set quit
hi def link maudeCommand Special
syn region maudeComment start='\%(^\|\s\)\zs\%(\*\*\*\|---\)' end='$'
\ contains=maudeCommentP,maudeTodo
hi def link maudeComment Comment
syn region maudeCommentP contained start='(' end=')'
\ contains=maudeCommentP,maudeTodo
hi def link maudeCommentP maudeComment
syn keyword maudeTodo contained TODO FIXME XXX
hi def link maudeTodo Todo