7
|
1 " Vim syntax file
|
|
2 " Language: rpcgen
|
6479
|
3 " Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
6484
|
4 " Last Change: Jan 13, 2015
|
|
5 " Version: 10
|
6479
|
6 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN
|
7
|
7
|
6484
|
8 if exists("b:current_syntax")
|
7
|
9 finish
|
|
10 endif
|
|
11
|
|
12 " Read the C syntax to start with
|
|
13 if version < 600
|
|
14 source <sfile>:p:h/c.vim
|
|
15 else
|
|
16 runtime! syntax/c.vim
|
|
17 endif
|
|
18
|
|
19 syn keyword rpcProgram program skipnl skipwhite nextgroup=rpcProgName
|
|
20 syn match rpcProgName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcProgZone
|
|
21 syn region rpcProgZone contained matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\(\d\+\|0x[23]\x\{7}\)\s*;"me=e-1 contains=rpcVersion,cComment,rpcProgNmbrErr
|
|
22 syn keyword rpcVersion contained version skipnl skipwhite nextgroup=rpcVersName
|
|
23 syn match rpcVersName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcVersZone
|
|
24 syn region rpcVersZone contained matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\d\+\s*;"me=e-1 contains=cType,cStructure,cStorageClass,rpcDecl,rpcProcNmbr,cComment
|
|
25 syn keyword rpcDecl contained string
|
|
26 syn match rpcProcNmbr contained "=\s*\d\+;"me=e-1
|
|
27 syn match rpcProgNmbrErr contained "=\s*0x[^23]\x*"ms=s+1
|
|
28 syn match rpcPassThru "^\s*%.*$"
|
|
29
|
|
30 " Define the default highlighting.
|
|
31 " For version 5.7 and earlier: only when not done already
|
|
32 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
33 if version >= 508 || !exists("did_rpcgen_syntax_inits")
|
|
34 if version < 508
|
|
35 let did_rpcgen_syntax_inits = 1
|
|
36 command -nargs=+ HiLink hi link <args>
|
|
37 else
|
|
38 command -nargs=+ HiLink hi def link <args>
|
|
39 endif
|
|
40
|
|
41 HiLink rpcProgName rpcName
|
|
42 HiLink rpcProgram rpcStatement
|
|
43 HiLink rpcVersName rpcName
|
|
44 HiLink rpcVersion rpcStatement
|
|
45
|
|
46 HiLink rpcDecl cType
|
|
47 HiLink rpcPassThru cComment
|
|
48
|
|
49 HiLink rpcName Special
|
|
50 HiLink rpcProcNmbr Delimiter
|
|
51 HiLink rpcProgNmbrErr Error
|
|
52 HiLink rpcStatement Statement
|
|
53
|
|
54 delcommand HiLink
|
|
55 endif
|
|
56
|
|
57 let b:current_syntax = "rpcgen"
|
|
58
|
|
59 " vim: ts=8
|