4 " Maintainer: Dr. Charles E. Campbell, Jr. <Charles.E.Campbell.1@gsfc.nasa.gov>
5 " Last Change: April 23, 1999
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 " Read the C syntax to start with
17 source <sfile>:p:h/c.vim
22 syn keyword rpcProgram program skipnl skipwhite nextgroup=rpcProgName
23 syn match rpcProgName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcProgZone
24 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
25 syn keyword rpcVersion contained version skipnl skipwhite nextgroup=rpcVersName
26 syn match rpcVersName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcVersZone
27 syn region rpcVersZone contained matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\d\+\s*;"me=e-1 contains=cType,cStructure,cStorageClass,rpcDecl,rpcProcNmbr,cComment
28 syn keyword rpcDecl contained string
29 syn match rpcProcNmbr contained "=\s*\d\+;"me=e-1
30 syn match rpcProgNmbrErr contained "=\s*0x[^23]\x*"ms=s+1
31 syn match rpcPassThru "^\s*%.*$"
33 " Define the default highlighting.
34 " For version 5.7 and earlier: only when not done already
35 " For version 5.8 and later: only when an item doesn't have highlighting yet
36 if version >= 508 || !exists("did_rpcgen_syntax_inits")
38 let did_rpcgen_syntax_inits = 1
39 command -nargs=+ HiLink hi link <args>
41 command -nargs=+ HiLink hi def link <args>
44 HiLink rpcProgName rpcName
45 HiLink rpcProgram rpcStatement
46 HiLink rpcVersName rpcName
47 HiLink rpcVersion rpcStatement
50 HiLink rpcPassThru cComment
52 HiLink rpcName Special
53 HiLink rpcProcNmbr Delimiter
54 HiLink rpcProgNmbrErr Error
55 HiLink rpcStatement Statement
60 let b:current_syntax = "rpcgen"