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