-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
cmod.vim
76 lines (61 loc) · 2.47 KB
/
cmod.vim
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
" Vim syntax file
" Language: Cmod
" Current Maintainer: Stephen R. van den Berg <srb@cuci.nl>
" Last Change: 2018 Jan 18
" Remark: Is used to edit Cmod files for Pike development
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" Read the C syntax to start with
runtime! syntax/c.vim
unlet b:current_syntax
" For embedded Autodoc documentation
syn include @cmodAutodoc <sfile>:p:h/autodoc.vim
unlet b:current_syntax
" Supports rotating amongst several same-level preprocessor conditionals
packadd! matchit
let b:match_words = "^\s*#\s*\%(if\%(n\?def\)\|else\|el\%(se\)\?if\|endif\)\>"
" Cmod extensions
syn keyword cmodStatement __INIT INIT EXIT GC_RECURSE GC_CHECK
syn keyword cmodStatement EXTRA OPTIMIZE RETURN
syn keyword cmodStatement ADD_EFUN ADD_EFUN2 ADD_FUNCTION
syn keyword cmodStatement MK_STRING MK_STRING_SVALUE CONSTANT_STRLEN
syn keyword cmodAccess public protected private INHERIT
syn keyword cmodAccess CTYPE CVAR PIKEVAR PIKEFUN
syn keyword cmodModifier efun export flags optflags optfunc
syn keyword cmodModifier type rawtype errname name c_name prototype
syn keyword cmodModifier program_flags gc_trivial
syn keyword cmodType bool mapping string multiset array mixed
syn keyword cmodType object function program auto
syn keyword cmodType bignum longest zero
syn keyword cmodType this this_program
syn keyword cmodOperator _destruct create __hash _sizeof _indices _values
syn keyword cmodOperator _is_type _sprintf _equal _m_delete _get_iterator
syn keyword cmodOperator _search _types _serialize _deserialize
syn keyword cmodOperator _size_object _random _sqrt
syn keyword cmodStructure DECLARATIONS PIKECLASS DECLARE_STORAGE
syn match cmodAutodocReal display contained "!.*" contains=@cmodAutodoc containedin=cComment,cCommentL
syn cluster cCommentGroup add=cmodAutodocReal
syn cluster cPreProcGroup add=cmodAutodocReal
" Default highlighting
hi def link cmodAccess Statement
hi def link cmodCast Statement
hi def link cmodExceptions Exception
hi def link cmodOperator Operator
hi def link cmodStatement Statement
hi def link cmodModifier Type
hi def link cmodType Type
hi def link cmodStorageClass StorageClass
hi def link cmodStructure Structure
hi def link cmodBoolean Boolean
hi def link cmodConstant Constant
hi def link cmodRawStringDelimiter Delimiter
hi def link cmodRawString String
hi def link cmodNumber Number
let b:current_syntax = "cmod"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8