summaryrefslogtreecommitdiff
path: root/syntax/kpl.vim
blob: 9722c79dc4660d26981d46299c16e58200543833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

" Operators
syn match kplOperator "[~!$%&*\-+=|:'<,>\./]"
hi def link kplOperator Operator

" Comments
syn match kplTodo contained "\<TODO\>" contains=@NoSpell
syn match kplCommentLine "\/\/.*$" contains=kplTodo
syn region kplCommentRange start="/\*" end="\*/" contains=kplTodo
hi def link kplTodo TODO
hi def link kplCommentLine Comment
hi def link kplCommentRange Comment

" Semicolon
syn match kplSemicolon ";"
hi def link kplSemicolon Comment

" Number
syn match kplNumber "\d\+\%(\.\d\+\)\?"
hi def link kplNumber Number

" String
syn region kplString start=/"/ skip=/\\\\"/ end=/"/
hi def link kplString String

" Var
syn match kplVar "[a-z]\w*" contains=@NoSpell
hi def link kplVar Ignore

" Ignore
syn match kplIgnore "\<_\w*" contains=@NoSpell
hi def link kplIgnore Comment

" Symbol
syn match kplSymbol "\.\w\+" contains=@NoSpell
hi def link kplSymbol Identifier

" Keyword
syn match kplKeyword "`[a-z]\w*" contains=@NoSpell
hi def link kplKeyword Conditional

" Type
syn match kplType "[A-Z]\w*" contains=@NoSpell
hi def link kplType Type

" Qualifiers
syn match kplQualifiers "Const\|Empty\|Lock\|Ref" contains=@NoSpell
hi def link kplQualifiers Repeat

" Define
syn match kplDefine "\[\|\]"
hi def link kplDefine Define

" List
syn match kplList "[()]"
hi def link kplList Special

" Action
syn match kplAction "[?@#^{}]"
hi def link kplAction Function