]> Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - .vim/bundle/mumps/syntax/mumps.vim
.screenrc: Don't run 'screen -ls' backtick
[dotfiles.git] / .vim / bundle / mumps / syntax / mumps.vim
1 " Mumps syntax file
2 " Language: MUMPS
3 " Maintainer: Jim Self, jaself@ucdavis.edu
4 " Last change: 02 June 2001
5
6 " related formatting, jas 24Sept03 - experimental
7 set lbr
8 set breakat=\ ,
9 set showbreak=\ \ \ \ \ \ \ +\
10
11 " Remove any old syntax stuff hanging around
12 syn clear
13 syn sync maxlines=0
14 syn sync minlines=0
15 syn case ignore
16
17 "errors
18 syn match mumpsError contained /[^ \t;].\+/
19 syn match mumpsBadString /".*/
20 " Catch mismatched parentheses
21 syn match mumpsParenError /).*/
22 syn match mumpsBadParen /(.*/
23
24
25 " Line Structure
26 syn region mumpsComment contained start=/;/ end=/$/
27 " contains=mumpsTodo
28 syn region mumpsTodo contained start=/TODO/ start=/XXX/ start=/FIX/ start=/DEBUG/ start=/DISABLED/ end=/;/ end=/$/
29
30 syn match mumpsLabel contained /^[%A-Za-z][A-Za-z0-9]*\|^[0-9]\+/ nextgroup=mumpsFormalArgs
31 syn region mumpsFormalArgs contained oneline start=/(/ end=/)/ contains=mumpsLocalName,","
32 syn match mumpsDotLevel contained /\.[. \t]*/
33
34 syn region mumpsCmd contained oneline start=/[A-Za-z]/ end=/[ \t]/ end=/$/ contains=mumpsCommand,mumpsZCommand,mumpsPostCondition,mumpsError nextgroup=mumpsArgsSeg
35 syn region mumpsPostCondition contained oneline start=/:/hs=s+1 end=/[ \t]/re=e-1,he=e-1,me=e-1 end=/$/ contains=@mumpsExpr
36 syn region mumpsArgsSeg contained oneline start=/[ \t]/lc=1 end=/[ \t]\+/ end=/$/ contains=@mumpsExpr,",",mumpsPostCondition
37
38 syn match mumpsLineStart contained /^[ \t][. \t]*/
39 syn match mumpsLineStart contained /^[%A-Za-z][^ \t;]*[. \t]*/ contains=mumpsLabel,mumpsDotLevel
40 syn region mumpsLine start=/^/ keepend end=/$/ contains=mumpsCmd,mumpsLineStart,mumpsComment
41
42 syn cluster mumpsExpr contains=mumpsVar,mumpsIntrinsic,mumpsExtrinsic,mumpsString,mumpsParen,mumpsOperator,mumpsBadString,mumpsBadNum,mumpsVRecord
43
44 syn match mumpsVar contained /\^=[%A-Za-z][A-Za-z0-9]*/ nextgroup=mumpsSubs
45 syn match mumpsIntrinsic contained /$[%A-Za-z][A-Za-z0-9]*/ contains=mumpsIntrinsicFunc,mumpsZInFunc,mumpsSpecialVar,mumpsZVar nextgroup=mumpsParams
46 syn match mumpsExtrinsic contained /$$[%A-Za-z][A-Za-z0-9]*\(^[%A-Za-z][A-Za-z0-9]*\)\=/ nextgroup=mumpsParams
47
48 syn match mumpsLocalName contained /[%A-Za-z][A-Za-z0-9]*/
49
50 " Operators
51 syn match mumpsOperator contained "[+\-*/=&#!'\\\]<>?@]"
52 syn match mumpsOperator contained "]]"
53 syn region mumpsVRecord contained start=/[= \t,]</lc=1 end=/>/ contains=mumpsLocalName,","
54
55 " Constants
56 syn region mumpsString contained oneline start=/"/ skip=/""/ excludenl end=/"/ oneline
57 syn match mumpsBadNum contained /\<0\d+\>/
58 syn match mumpsBadNum contained /\<\d*\.\d*0\>/
59 syn match mumpsNumber contained /\<\d*\.\d{1,9}\>/
60 syn match mumpsNumber contained /\<\d+\>/
61
62 syn region mumpsParen contained oneline start=/(/ end=/)/ contains=@mumpsExpr
63 syn region mumpsSubs contained oneline start=/(/ end=/)/ contains=@mumpsExpr,","
64 syn region mumpsActualArgs contained oneline start=/(/ end=/)/ contains=@mumpsExpr,","
65
66 " Keyword definitions -------------------
67 "-- Commands --
68 syn keyword mumpsCommand contained B[reak] C[lose] D[o] E[lse] F[or] G[oto] H[alt] H[ang]
69 syn keyword mumpsCommand contained I[f] J[ob] K[ill] L[ock] M[erge] N[ew] O[pen] Q[uit]
70 syn keyword mumpsCommand contained R[ead] S[et] TC[ommit] TRE[start] TRO[llback] TS[tart]
71 syn keyword mumpsCommand contained U[se] V[iew] W[rite] X[ecute]
72
73 " -- GT.M specific --
74 syn keyword mumpsZCommand contained ZA[llocate] ZB[reak] ZCOM[pile] ZC[ontinue] ZD[eallocate]
75 syn keyword mumpsZCommand contained ZED[it] ZG[oto] ZH[elp] ZL[ink] ZM[essage] ZP[rint]
76 syn keyword mumpsZCommand contained ZSH[ow] ZST[ep] ZSY[stem] ZTC[ommit] ZTS[tart]
77 syn keyword mumpsZCommand contained ZWI[thdraw] ZWR[ite]
78
79 " -- DTM specific --
80 "syn keyword mumpsZCommand contained zC[all] zET[rap] zHT[rap] zIT[rap] zK[ill] zNS[pace]
81 "syn keyword mumpsZCommand contained zQ[uit] zS[ave] zSync zTrap zUnRead zUse zzDevStat
82 "syn keyword mumpsZCommand contained zzDOS zzErr zzKeyPut zzLog zzNaked zzSetKey zzSwitch
83
84 "-- Intrinsic Functions
85 syn keyword mumpsIntrinsicFunc contained A[scii] C[har] D[ata] E[xtract] F[ind] FN[umber] G[et]
86 syn keyword mumpsIntrinsicFunc contained J[ustify] L[ength] N[ame] N[ext] O[rder] P[iece]
87 syn keyword mumpsIntrinsicFunc contained Q[uery] R[andom] S[elect] T[ext] T[ranslate] V[iew]
88
89 "----> DTM Trig functions
90 "syn keyword mumpsZInFunc contained zAbs zArcCos zArcSin zArcTan
91 "syn keyword mumpsZInFunc contained zCos zCot zCSC zExp zLn zLog
92 "syn keyword mumpsZInFunc contained zSec zSin zSqr zTan zPower
93
94 "----> DTM Bitstring functions
95 "syn keyword mumpsZInFunc contained zBitAnd zBitCount zBitFind
96 "syn keyword mumpsZInFunc contained zBitGet zBitLen zBitNot zBitOr
97 "syn keyword mumpsZInFunc contained zBitSet zBitStr zBitXor
98
99 "----> DTM Mouse functions --
100 "syn keyword mumpsZInFunc contained zMouseInit zMouseReset zMouseInfo zMouseShow zMouseHide
101 "syn keyword mumpsZInFunc contained zMouseReport zMouseXYMax zMouseSetInrpt zMouseReportI
102 "syn keyword mumpsZInFunc contained zMouseReportM zMouseReportP zMouseReportR zMousePut
103 "syn keyword mumpsZInFunc contained zMouseGetSV zMouseSetSV zMouseExclude zMouseLimits
104 "syn keyword mumpsZInFunc contained zMousePointerT zMouseCursor zMouseSave zMouseRestore
105
106 "----> DTM other functions --
107 "syn keyword mumpsZInFunc contained zCall zConvert zCvt zCRC zD[ate]
108 "syn keyword mumpsZInFunc contained zDev zEName zJob zLA[scii] zLC[har]
109 "syn keyword mumpsZInFunc contained zOLen zO[rder] zPrevious zR[eference] zRNext
110 "syn keyword mumpsZInFunc contained zwA[scii] zWC[har] zX[ecute] zzDec zzEnv zzHex
111
112 " -- GT.M z-functions --
113 syn keyword mumpsZInFunc contained ZD[ate] ZM[essage] ZPARSE ZP[revious] ZSEARCH ZTRNLNM
114
115 " Special Variables
116 syn keyword mumpsSpecialVar contained D[evice] H[orolog] I[O] J[ob] K[ey] P[rincipal]
117 syn keyword mumpsSpecialVar contained S[torage] T[est] TL[evel] TR[estart] X Y
118
119 "-- DTM specific --
120 "syn keyword mumpsZVar contained zA zB zD[ate] zDepth zDev
121 "syn keyword mumpsZVar contained zDevClass zDevixXlate zDevixInterp
122 "syn keyword mumpsZVar contained zDevR zDevTerm zDevType zE zEName
123 "syn keyword mumpsZVar contained zErr[or] zETrap zH[orolog] zIOS zIOT
124 "syn keyword mumpsZVar contained zJob zMode zName zNode zzNode
125 "syn keyword mumpsZVar contained zNSpace zPI zP[iece] zR[eference]
126 "syn keyword mumpsZVar contained zS[torage] zT[rap] zVer[sion] zX zY zzB
127 "syn keyword mumpsZVar contained zzBreak zzCompat zzEnv zzErr zzJobName
128 "syn keyword mumpsZVar contained zzLicense zzNaked zzSwitch
129
130 "-- GT.M specific --
131 syn keyword mumpsZVar contained ZCSTATUS ZDIR[ectory] ZEDIT ZEOF ZGBL[dir]
132 syn keyword mumpsZVar contained ZIO ZL[evel] ZPOS[ition] ZPROMP[t] ZRO[utines]
133 syn keyword mumpsZVar contained ZSO[urce] ZS[tatus] ZSYSTEM ZT[rap] ZVER[sion]
134
135 if !exists("did_mumps_syntax_inits")
136 let did_mumps_syntax_inits = 1
137
138 " The default methods for hilighting. Can be overridden later
139 hi! link mumpsCommand Statement
140 "hi! link mumpsZCommand PreProc
141 hi! link mumpsZCommand Statement
142 hi! link mumpsIntrinsicFunc Function
143 hi! link mumpsZInFunc Preproc
144 hi! link mumpsSpecialVar Function
145 hi! link mumpsZVar PreProc
146 hi! link mumpsLineStart Statement
147 hi! link mumpsLabel PreProc
148 hi! link mumpsFormalArgs PreProc
149 hi! link mumpsDotLevel PreProc
150 hi! link mumpsCmdSeg Special
151 hi! link mumpsPostCondition Special
152 hi! link mumpsCmd Statement
153 hi! link mumpsArgsSeg Special
154 hi! link mumpsExpr PreProc
155 hi! link mumpsVar Identifier
156 hi! link mumpsParen Special
157 hi! link mumpsSubs Special
158 hi! link mumpsActualArgs Special
159 hi! link mumpsIntrinsic Special
160 hi! link mumpsExtrinsic Special
161 hi! link mumpsString String
162 hi! link mumpsNumber Number
163 hi! link mumpsOperator Special
164 hi! link mumpsComment Comment
165 hi! link mumpsError Error
166 hi! link mumpsBadNum Error
167 hi! link mumpsBadString Error
168 hi! link mumpsBadParen Error
169 hi! link mumpsParenError Error
170
171 hi! link mumpsTodo Todo
172 endif
173
174 let b:current_syntax = "mumps"
175
176 " vim: ts=8