annotate runtime/syntax/cmod.vim @ 19484:0af19002b9a6

Added tag v8.2.0299 for changeset 0d3dcb4476ba48760962150ef4864cb6c63c4fa2
author Bram Moolenaar <Bram@vim.org>
date Sat, 22 Feb 2020 19:15:05 +0100
parents 371ceeebbdaa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13125
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim syntax file
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Language: Cmod
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Current Maintainer: Stephen R. van den Berg <srb@cuci.nl>
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Last Change: 2018 Jan 23
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " Version: 2.9
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " Remark: Is used to edit Cmod files for Pike development.
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " Remark: Includes a highlighter for any embedded Autodoc format.
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 " quit when a syntax file was already loaded
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 if exists("b:current_syntax")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 finish
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 let s:cpo_save = &cpo
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 set cpo&vim
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 " Read the C syntax to start with
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 runtime! syntax/c.vim
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 unlet b:current_syntax
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 if !exists("c_autodoc")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " For embedded Autodoc documentation
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 syn include @cmodAutodoc <sfile>:p:h/autodoc.vim
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 unlet b:current_syntax
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 " Supports rotating amongst several same-level preprocessor conditionals
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 packadd! matchit
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 let b:match_words = "({:}\\@1<=),^\s*#\s*\%(if\%(n\?def\)\|else\|el\%(se\)\?if\|endif\)\>"
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 " Cmod extensions
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 syn keyword cmodStatement __INIT INIT EXIT GC_RECURSE GC_CHECK
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 syn keyword cmodStatement EXTRA OPTIMIZE RETURN
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 syn keyword cmodStatement ADD_EFUN ADD_EFUN2 ADD_FUNCTION
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 syn keyword cmodStatement MK_STRING MK_STRING_SVALUE CONSTANT_STRLEN
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 syn keyword cmodStatement SET_SVAL pop_n_elems pop_stack
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 syn keyword cmodStatement SIMPLE_ARG_TYPE_ERROR Pike_sp Pike_fp MKPCHARP
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 syn keyword cmodStatement SET_SVAL_TYPE REF_MAKE_CONST_STRING INC_PCHARP
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 syn keyword cmodStatement PTR_FROM_INT INHERIT_FROM_PTR
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 syn keyword cmodStatement DECLARE_CYCLIC BEGIN_CYCLIC END_CYCLIC
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 syn keyword cmodStatement UPDATE_LOCATION UNSAFE_IS_ZERO SAFE_IS_ZERO
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 syn keyword cmodStatement MKPCHARP_STR APPLY_MASTER current_storage
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 syn keyword cmodStatement PIKE_MAP_VARIABLE size_shift
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 syn keyword cmodStatement THREADS_ALLOW THREADS_DISALLOW
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 syn keyword cmodStatement add_integer_constant ref_push_object
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 syn keyword cmodStatement push_string apply_svalue free_svalue
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 syn keyword cmodStatement get_inherit_storage get_storage
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 syn keyword cmodStatement make_shared_binary_string push_int64
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 syn keyword cmodStatement begin_shared_string end_shared_string
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 syn keyword cmodStatement add_ref fast_clone_object clone_object
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 syn keyword cmodStatement push_undefined push_int ref_push_string
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 syn keyword cmodStatement free_string push_ulongest free_object
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 syn keyword cmodStatement convert_stack_top_to_bignum push_array
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 syn keyword cmodStatement push_object reduce_stack_top_bignum
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 syn keyword cmodStatement push_static_text apply_current
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 syn keyword cmodStatement assign_svalue free_program destruct_object
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 syn keyword cmodStatement start_new_program low_inherit stack_swap
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 syn keyword cmodStatement generic_error_program end_program
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 syn keyword cmodStatement free_array apply_external copy_mapping
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 syn keyword cmodStatement push_constant_text ref_push_mapping
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 syn keyword cmodStatement mapping_insert mapping_string_insert_string
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 syn keyword cmodStatement f_aggregate_mapping f_aggregate apply
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 syn keyword cmodStatement push_mapping push_svalue low_mapping_lookup
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 syn keyword cmodStatement assign_svalues_no_free f_add
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 syn keyword cmodStatement push_empty_string stack_dup assign_lvalue
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 syn keyword cmodStatement low_mapping_string_lookup allocate_mapping
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 syn keyword cmodStatement copy_shared_string make_shared_binary_string0
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 syn keyword cmodStatement f_call_function f_index f_utf8_to_string
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 syn keyword cmodStatement finish_string_builder init_string_builder
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 syn keyword cmodStatement reset_string_builder free_string_builder
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 syn keyword cmodStatement string_builder_putchar get_all_args
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 syn keyword cmodStatement add_shared_strings check_all_args
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 syn keyword cmodStatement do_inherit add_string_constant
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 syn keyword cmodStatement add_program_constant set_init_callback
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 syn keyword cmodStatement simple_mapping_string_lookup
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 syn keyword cmodStatement f_sprintf push_text string_has_null
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 syn keyword cmodStatement end_and_resize_shared_string
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 syn keyword cmodStatement args sp
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 syn keyword cmodStatement free
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 syn keyword cmodConstant ID_PROTECTED ID_FINAL PIKE_DEBUG
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 syn keyword cmodConstant NUMBER_NUMBER
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 syn keyword cmodConstant PIKE_T_INT PIKE_T_STRING PIKE_T_ARRAY
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 syn keyword cmodConstant PIKE_T_MULTISET PIKE_T_OBJECT PIKE_T_MAPPING
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 syn keyword cmodConstant NUMBER_UNDEFINED PIKE_T_PROGRAM PIKE_T_FUNCTION
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 syn keyword cmodConstant T_OBJECT T_STRING T_ARRAY T_MAPPING
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 syn keyword cmodException SET_ONERROR UNSET_ONERROR ONERROR
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 syn keyword cmodException CALL_AND_UNSET_ONERROR
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 syn keyword cmodDebug Pike_fatal Pike_error check_stack
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 syn keyword cmodAccess public protected private INHERIT
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 syn keyword cmodAccess CTYPE CVAR PIKEVAR PIKEFUN
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 syn keyword cmodModifier efun export flags optflags optfunc
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 syn keyword cmodModifier type rawtype errname name c_name prototype
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 syn keyword cmodModifier program_flags gc_trivial PMOD_EXPORT
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 syn keyword cmodModifier ATTRIBUTE noclone noinline
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 syn keyword cmodModifier tOr tFuncV tInt tMix tVoid tStr tMap tPrg
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 syn keyword cmodModifier tSetvar tArr tMult tMultiset
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 syn keyword cmodModifier tArray tMapping tString tSetvar tVar
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 syn keyword cmodType bool mapping string multiset array mixed
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 syn keyword cmodType object function program auto svalue
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 syn keyword cmodType bignum longest zero pike_string
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 syn keyword cmodType this this_program THIS INT_TYPE INT64 INT32
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 syn keyword cmodType p_wchar2 PCHARP p_wchar1 p_wchar0 MP_INT
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 syn keyword cmodOperator _destruct create __hash _sizeof _indices _values
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 syn keyword cmodOperator _is_type _sprintf _equal _m_delete _get_iterator
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 syn keyword cmodOperator _search _types _serialize _deserialize
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 syn keyword cmodOperator _size_object _random _sqrt TYPEOF SUBTYPEOF
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 syn keyword cmodOperator LIKELY UNLIKELY
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 syn keyword cmodStructure DECLARATIONS PIKECLASS DECLARE_STORAGE
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 if !exists("c_autodoc")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 syn match cmodAutodocReal display contained "\%(//\|[/ \t\v]\*\|^\*\)\@2<=!.*" contains=@cmodAutodoc containedin=cComment,cCommentL
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 syn cluster cCommentGroup add=cmodAutodocReal
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 syn cluster cPreProcGroup add=cmodAutodocReal
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 " Default highlighting
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 hi def link cmodAccess Statement
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 hi def link cmodOperator Operator
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 hi def link cmodStatement Statement
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132 hi def link cmodConstant Constant
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 hi def link cmodModifier Type
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 hi def link cmodType Type
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 hi def link cmodStorageClass StorageClass
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 hi def link cmodStructure Structure
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 hi def link cmodException Exception
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 hi def link cmodDebug Debug
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140 let b:current_syntax = "cmod"
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142 let &cpo = s:cpo_save
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143 unlet s:cpo_save
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 " vim: ts=8