ceevlang/syntax/ceev.vim

38 lines
1.1 KiB
VimL

if exists("b:current_syntax") | finish | endif
set iskeyword=a-z,A-Z,-,*,_,!,@
" Language keywords
syntax keyword ceevKeywords let unlet enter exit show hide
syntax keyword ceevTodos TODO
syntax keyword ceevConstant Character Location Image
" Comments
syntax region ceevCommentLine start="//" end="$" contains=ceevTodos
" String literals
syntax region ceevString start=/\v"/ skip=/\v\\./ end=/\v"/ contains=ceevEscapes
" Char literals
syntax region ceevChar start=/\v'/ skip=/\v\\./ end=/\v'/ contains=ceevEscapes
" Escape literals \n, \r, ....
syntax match ceevEscapes display contained "\\[nr\"']"
" Number literals
syntax region ceevNumber start=/\s\d/ skip=/\d/ end=/\s/
" Set highlights
highlight default link ceevTodos Todo
highlight default link ceevKeywords Keyword
highlight default link ceevConstant Constant
highlight default link ceevCommentLine Comment
highlight default link ceevString String
highlight default link ceevNumber Number
highlight default link ceevTypeNames Type
highlight default link ceevChar Character
highlight default link ceevEscapes SpecialChar
let b:current_syntax = "ceev"