Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: DCL (Digital Command Language - vms) |
| 3 | " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> |
Bram Moolenaar | 4440382 | 2005-09-06 19:13:27 +0000 | [diff] [blame] | 4 | " Last Change: Sep 06, 2005 |
| 5 | " Version: 4 |
| 6 | " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax |
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 | if version < 600 |
| 17 | set iskeyword=$,@,48-57,_ |
| 18 | else |
| 19 | setlocal iskeyword=$,@,48-57,_ |
| 20 | endif |
| 21 | |
| 22 | syn case ignore |
| 23 | syn keyword dclInstr accounting del[ete] gen[cat] mou[nt] run |
| 24 | syn keyword dclInstr all[ocate] dep[osit] gen[eral] ncp run[off] |
| 25 | syn keyword dclInstr ana[lyze] dia[gnose] gos[ub] ncs sca |
| 26 | syn keyword dclInstr app[end] dif[ferences] got[o] on sea[rch] |
| 27 | syn keyword dclInstr ass[ign] dir[ectory] hel[p] ope[n] set |
| 28 | syn keyword dclInstr att[ach] dis[able] ico[nv] pas[cal] sho[w] |
| 29 | syn keyword dclInstr aut[horize] dis[connect] if pas[sword] sor[t] |
| 30 | syn keyword dclInstr aut[ogen] dis[mount] ini[tialize] pat[ch] spa[wn] |
| 31 | syn keyword dclInstr bac[kup] dpm[l] inq[uire] pca sta[rt] |
| 32 | syn keyword dclInstr cal[l] dqs ins[tall] pho[ne] sto[p] |
| 33 | syn keyword dclInstr can[cel] dsr job pri[nt] sub[mit] |
| 34 | syn keyword dclInstr cc dst[graph] lat[cp] pro[duct] sub[routine] |
| 35 | syn keyword dclInstr clo[se] dtm lib[rary] psw[rap] swx[cr] |
| 36 | syn keyword dclInstr cms dum[p] lic[ense] pur[ge] syn[chronize] |
| 37 | syn keyword dclInstr con[nect] edi[t] lin[k] qde[lete] sys[gen] |
| 38 | syn keyword dclInstr con[tinue] ena[ble] lmc[p] qse[t] sys[man] |
| 39 | syn keyword dclInstr con[vert] end[subroutine] loc[ale] qsh[ow] tff |
| 40 | syn keyword dclInstr cop[y] eod log[in] rea[d] then |
| 41 | syn keyword dclInstr cre[ate] eoj log[out] rec[all] typ[e] |
| 42 | syn keyword dclInstr cxx exa[mine] lse[dit] rec[over] uil |
| 43 | syn keyword dclInstr cxx[l_help] exc[hange] mac[ro] ren[ame] unl[ock] |
| 44 | syn keyword dclInstr dea[llocate] exi[t] mai[l] rep[ly] ves[t] |
| 45 | syn keyword dclInstr dea[ssign] fdl mer[ge] req[uest] vie[w] |
| 46 | syn keyword dclInstr deb[ug] flo[wgraph] mes[sage] ret[urn] wai[t] |
| 47 | syn keyword dclInstr dec[k] fon[t] mms rms wri[te] |
| 48 | syn keyword dclInstr def[ine] for[tran] |
| 49 | |
| 50 | syn keyword dclLexical f$context f$edit f$getjpi f$message f$setprv |
| 51 | syn keyword dclLexical f$csid f$element f$getqui f$mode f$string |
| 52 | syn keyword dclLexical f$cvsi f$environment f$getsyi f$parse f$time |
| 53 | syn keyword dclLexical f$cvtime f$extract f$identifier f$pid f$trnlnm |
| 54 | syn keyword dclLexical f$cvui f$fao f$integer f$privilege f$type |
| 55 | syn keyword dclLexical f$device f$file_attributes f$length f$process f$user |
| 56 | syn keyword dclLexical f$directory f$getdvi f$locate f$search f$verify |
| 57 | |
| 58 | syn match dclMdfy "/\I\i*" nextgroup=dclMdfySet,dclMdfySetString |
| 59 | syn match dclMdfySet "=[^ \t"]*" contained |
| 60 | syn region dclMdfySet matchgroup=dclMdfyBrkt start="=\[" matchgroup=dclMdfyBrkt end="]" contains=dclMdfySep |
| 61 | syn region dclMdfySetString start='="' skip='""' end='"' contained |
| 62 | syn match dclMdfySep "[:,]" contained |
| 63 | |
| 64 | " Numbers |
| 65 | syn match dclNumber "\d\+" |
| 66 | |
| 67 | " Varname (mainly to prevent dclNumbers from being recognized when part of a dclVarname) |
| 68 | syn match dclVarname "\I\i*" |
| 69 | |
| 70 | " Filenames (devices, paths) |
| 71 | syn match dclDevice "\I\i*\(\$\I\i*\)\=:[^=]"me=e-1 nextgroup=dclDirPath,dclFilename |
| 72 | syn match dclDirPath "\[\(\I\i*\.\)*\I\i*\]" contains=dclDirSep nextgroup=dclFilename |
| 73 | syn match dclFilename "\I\i*\$\(\I\i*\)\=\.\(\I\i*\)*\(;\d\+\)\=" contains=dclDirSep |
| 74 | syn match dclFilename "\I\i*\.\(\I\i*\)\=\(;\d\+\)\=" contains=dclDirSep contained |
| 75 | syn match dclDirSep "[[\].;]" |
| 76 | |
| 77 | " Strings |
| 78 | syn region dclString start='"' skip='""' end='"' |
| 79 | |
| 80 | " $ stuff and comments |
| 81 | syn cluster dclCommentGroup contains=dclStart,dclTodo,@Spell |
| 82 | syn match dclStart "^\$" skipwhite nextgroup=dclExe |
| 83 | syn match dclContinue "-$" |
| 84 | syn match dclComment "^\$!.*$" contains=@dclCommentGroup |
| 85 | syn match dclExe "\I\i*" contained |
| 86 | syn match dclTodo "DEBUG\|TODO" contained |
| 87 | |
| 88 | " Assignments and Operators |
| 89 | syn match dclAssign ":==\=" |
| 90 | syn match dclAssign "=" |
| 91 | syn match dclOper "--\|+\|\*\|/" |
| 92 | syn match dclLogOper "\.[a-zA-Z][a-zA-Z][a-zA-Z]\=\." contains=dclLogical,dclLogSep |
| 93 | syn keyword dclLogical contained and ge gts lt nes |
| 94 | syn keyword dclLogical contained eq ges le lts not |
| 95 | syn keyword dclLogical contained eqs gt les ne or |
| 96 | syn match dclLogSep "\." contained |
| 97 | |
| 98 | " @command procedures |
| 99 | syn match dclCmdProcStart "@" nextgroup=dclCmdProc |
| 100 | syn match dclCmdProc "\I\i*\(\.\I\i*\)\=" contained |
| 101 | syn match dclCmdProc "\I\i*:" contained nextgroup=dclCmdDirPath,dclCmdProc |
| 102 | syn match dclCmdDirPath "\[\(\I\i*\.\)*\I\i*\]" contained nextgroup=delCmdProc |
| 103 | |
| 104 | " labels |
| 105 | syn match dclGotoLabel "^\$\s*\I\i*:\s*$" contains=dclStart |
| 106 | |
| 107 | " parameters |
| 108 | syn match dclParam "'\I[a-zA-Z0-9_$]*'\=" |
| 109 | |
| 110 | " () matching (the clusters are commented out until a vim/vms comes out for v5.2+) |
| 111 | "syn cluster dclNextGroups contains=dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo |
| 112 | "syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,@dclNextGroups |
| 113 | syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo |
| 114 | syn match dclError ")" |
| 115 | |
| 116 | " Define the default highlighting. |
| 117 | " For version 5.7 and earlier: only when not done already |
| 118 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 119 | if version >= 508 || !exists("did_dcl_syntax_inits") |
| 120 | if version < 508 |
| 121 | let did_dcl_syntax_inits = 1 |
| 122 | command -nargs=+ HiLink hi link <args> |
| 123 | else |
| 124 | command -nargs=+ HiLink hi def link <args> |
| 125 | endif |
| 126 | |
| 127 | HiLink dclLogOper dclError |
| 128 | HiLink dclLogical dclOper |
| 129 | HiLink dclLogSep dclSep |
| 130 | |
| 131 | HiLink dclAssign Operator |
| 132 | HiLink dclCmdProc Special |
| 133 | HiLink dclCmdProcStart Operator |
| 134 | HiLink dclComment Comment |
| 135 | HiLink dclContinue Statement |
| 136 | HiLink dclDevice Identifier |
| 137 | HiLink dclDirPath Identifier |
| 138 | HiLink dclDirPath Identifier |
| 139 | HiLink dclDirSep Delimiter |
| 140 | HiLink dclError Error |
| 141 | HiLink dclExe Statement |
| 142 | HiLink dclFilename NONE |
| 143 | HiLink dclGotoLabel Label |
| 144 | HiLink dclInstr Statement |
| 145 | HiLink dclLexical Function |
| 146 | HiLink dclMdfy Type |
| 147 | HiLink dclMdfyBrkt Delimiter |
| 148 | HiLink dclMdfySep Delimiter |
| 149 | HiLink dclMdfySet Type |
| 150 | HiLink dclMdfySetString String |
| 151 | HiLink dclNumber Number |
| 152 | HiLink dclOper Operator |
| 153 | HiLink dclParam Special |
| 154 | HiLink dclSep Delimiter |
| 155 | HiLink dclStart Delimiter |
| 156 | HiLink dclString String |
| 157 | HiLink dclTodo Todo |
| 158 | |
| 159 | delcommand HiLink |
| 160 | endif |
| 161 | |
| 162 | let b:current_syntax = "dcl" |
| 163 | |
| 164 | " vim: ts=16 |