Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Cmod files (used in Pike development).
- Loading branch information
Showing
3 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters