3 " Maintainer: Jim Self, jaself@ucdavis.edu
4 " Last change: 02 June 2001
6 " related formatting, jas 24Sept03 - experimental
9 set showbreak=\ \ \ \ \ \ \ +\
11 " Remove any old syntax stuff hanging around
18 syn match mumpsError contained /[^ \t;].\+/
19 syn match mumpsBadString /".*/
20 " Catch mismatched parentheses
21 syn match mumpsParenError /).*/
22 syn match mumpsBadParen /(.*/
26 syn region mumpsComment contained start=/;/ end=/$/
28 syn region mumpsTodo contained start=/TODO/ start=/XXX/ start=/FIX/ start=/DEBUG/ start=/DISABLED/ end=/;/ end=/$/
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]*/
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
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
42 syn cluster mumpsExpr contains=mumpsVar,mumpsIntrinsic,mumpsExtrinsic,mumpsString,mumpsParen,mumpsOperator,mumpsBadString,mumpsBadNum,mumpsVRecord
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
48 syn match mumpsLocalName contained /[%A-Za-z][A-Za-z0-9]*/
51 syn match mumpsOperator contained "[+\-*/=&#!'\\\]<>?@]"
52 syn match mumpsOperator contained "]]"
53 syn region mumpsVRecord contained start=/[= \t,]</lc=1 end=/>/ contains=mumpsLocalName,","
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+\>/
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,","
66 " Keyword definitions -------------------
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]
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]
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
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]
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
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
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
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
112 " -- GT.M z-functions --
113 syn keyword mumpsZInFunc contained ZD[ate] ZM[essage] ZPARSE ZP[revious] ZSEARCH ZTRNLNM
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
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
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]
135 if !exists("did_mumps_syntax_inits")
136 let did_mumps_syntax_inits = 1
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
171 hi! link mumpsTodo Todo
174 let b:current_syntax = "mumps"