7
|
1 " MUSHcode syntax file
|
856
|
2 " Maintainer: Rick Bird <nveid@nveid.com>
|
557
|
3 " Based on vim Syntax file by: Bek Oberin <gossamer@tertius.net.au>
|
|
4 " Last Updated: Fri Nov 04 20:28:15 2005
|
|
5 "
|
7
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14
|
|
15 " regular mush functions
|
557
|
16
|
|
17 syntax keyword mushFunction contained @@ abs accent accname acos add after align
|
|
18 syntax keyword mushFunction contained allof alphamax alphamin and andflags
|
|
19 syntax keyword mushFunction contained andlflags andlpowers andpowers ansi aposs art
|
|
20 syntax keyword mushFunction contained asin atan atan2 atrlock attrcnt band baseconv
|
|
21 syntax keyword mushFunction contained beep before blank2tilde bnand bnot bor bound
|
|
22 syntax keyword mushFunction contained brackets break bxor cand cansee capstr case
|
|
23 syntax keyword mushFunction contained caseall cat ceil center checkpass children
|
|
24 syntax keyword mushFunction contained chr clone cmds cnetpost comp con config conn
|
|
25 syntax keyword mushFunction contained controls convsecs convtime convutcsecs cor
|
|
26 syntax keyword mushFunction contained cos create ctime ctu dec decrypt default
|
|
27 syntax keyword mushFunction contained delete die dig digest dist2d dist3d div
|
|
28 syntax keyword mushFunction contained division divscope doing downdiv dynhelp e
|
|
29 syntax keyword mushFunction contained edefault edit element elements elist elock
|
|
30 syntax keyword mushFunction contained emit empire empower encrypt endtag entrances
|
|
31 syntax keyword mushFunction contained eq escape etimefmt eval exit exp extract fdiv
|
|
32 syntax keyword mushFunction contained filter filterbool findable first firstof
|
|
33 syntax keyword mushFunction contained flags flip floor floordiv fmod fold
|
|
34 syntax keyword mushFunction contained folderstats followers following foreach
|
|
35 syntax keyword mushFunction contained fraction fullname functions get get_eval grab
|
|
36 syntax keyword mushFunction contained graball grep grepi gt gte hasattr hasattrp
|
|
37 syntax keyword mushFunction contained hasattrpval hasattrval hasdivpower hasflag
|
|
38 syntax keyword mushFunction contained haspower haspowergroup hastype height hidden
|
|
39 syntax keyword mushFunction contained home host hostname html idle idlesecs
|
|
40 syntax keyword mushFunction contained idle_average idle_times idle_total if ifelse
|
|
41 syntax keyword mushFunction contained ilev iname inc index indiv indivall insert
|
|
42 syntax keyword mushFunction contained inum ipaddr isdaylight isdbref isint isnum
|
|
43 syntax keyword mushFunction contained isword itemize items iter itext last lattr
|
|
44 syntax keyword mushFunction contained lcon lcstr ldelete ldivisions left lemit
|
|
45 syntax keyword mushFunction contained level lexits lflags link list lit ljust lmath
|
|
46 syntax keyword mushFunction contained ln lnum loc localize locate lock loctree log
|
|
47 syntax keyword mushFunction contained lparent lplayers lports lpos lsearch lsearchr
|
|
48 syntax keyword mushFunction contained lstats lt lte lthings lvcon lvexits lvplayers
|
|
49 syntax keyword mushFunction contained lvthings lwho mail maildstats mailfrom
|
|
50 syntax keyword mushFunction contained mailfstats mailstats mailstatus mailsubject
|
|
51 syntax keyword mushFunction contained mailtime map match matchall max mean median
|
|
52 syntax keyword mushFunction contained member merge mid min mix mod modulo modulus
|
|
53 syntax keyword mushFunction contained money mtime mudname mul munge mwho name nand
|
|
54 syntax keyword mushFunction contained nattr ncon nearby neq nexits next nor not
|
|
55 syntax keyword mushFunction contained nplayers nsemit nslemit nsoemit nspemit
|
|
56 syntax keyword mushFunction contained nsremit nszemit nthings null num nvcon
|
|
57 syntax keyword mushFunction contained nvexits nvplayers nvthings obj objeval objid
|
|
58 syntax keyword mushFunction contained objmem oemit ooref open or ord orflags
|
|
59 syntax keyword mushFunction contained orlflags orlpowers orpowers owner parent
|
|
60 syntax keyword mushFunction contained parse pcreate pemit pi pickrand playermem
|
|
61 syntax keyword mushFunction contained pmatch poll ports pos poss power powergroups
|
|
62 syntax keyword mushFunction contained powers powover program prompt pueblo quitprog
|
|
63 syntax keyword mushFunction contained quota r rand randword recv regedit regeditall
|
|
64 syntax keyword mushFunction contained regeditalli regediti regmatch regmatchi
|
|
65 syntax keyword mushFunction contained regrab regraball regraballi regrabi regrep
|
|
66 syntax keyword mushFunction contained regrepi remainder remit remove repeat replace
|
|
67 syntax keyword mushFunction contained rest restarts restarttime reswitch
|
|
68 syntax keyword mushFunction contained reswitchall reswitchalli reswitchi reverse
|
|
69 syntax keyword mushFunction contained revwords right rjust rloc rnum room root
|
|
70 syntax keyword mushFunction contained round s scan scramble search secs secure sent
|
|
71 syntax keyword mushFunction contained set setdiff setinter setq setr setunion sha0
|
|
72 syntax keyword mushFunction contained shl shr shuffle sign signal sin sort sortby
|
|
73 syntax keyword mushFunction contained soundex soundlike soundslike space spellnum
|
|
74 syntax keyword mushFunction contained splice sql sqlescape sqrt squish ssl
|
|
75 syntax keyword mushFunction contained starttime stats stddev step strcat strinsert
|
|
76 syntax keyword mushFunction contained stripaccents stripansi strlen strmatch
|
|
77 syntax keyword mushFunction contained strreplace sub subj switch switchall t table
|
|
78 syntax keyword mushFunction contained tag tagwrap tan tel terminfo textfile
|
|
79 syntax keyword mushFunction contained tilde2blank time timefmt timestring tr
|
|
80 syntax keyword mushFunction contained trigger trim trimpenn trimtiny trunc type u
|
|
81 syntax keyword mushFunction contained ucstr udefault ufun uldefault ulocal updiv
|
|
82 syntax keyword mushFunction contained utctime v vadd val valid vcross vdim vdot
|
|
83 syntax keyword mushFunction contained version visible vmag vmax vmin vmul vsub
|
|
84 syntax keyword mushFunction contained vtattr vtcount vtcreate vtdestroy vtlcon
|
|
85 syntax keyword mushFunction contained vtloc vtlocate vtmaster vtname vtref vttel
|
|
86 syntax keyword mushFunction contained vunit wait where width wipe wordpos words
|
|
87 syntax keyword mushFunction contained wrap xcon xexits xget xor xplayers xthings
|
|
88 syntax keyword mushFunction contained xvcon xvexits xvplayers xvthings zemit zfun
|
|
89 syntax keyword mushFunction contained zmwho zone zwho
|
|
90
|
7
|
91 " only highligh functions when they have an in-bracket immediately after
|
557
|
92 syntax match mushFunctionBrackets "\i*(" contains=mushFunction
|
|
93 "
|
7
|
94 " regular mush commands
|
557
|
95 syntax keyword mushAtCommandList contained @ALLHALT @ALLQUOTA @ASSERT @ATRCHOWN @ATRLOCK @ATTRIBUTE @BOOT
|
|
96 syntax keyword mushAtCommandList contained @BREAK @CEMIT @CHANNEL @CHAT @CHOWN @CHOWNALL @CHZONE @CHZONEALL
|
|
97 syntax keyword mushAtCommandList contained @CLOCK @CLONE @COBJ @COMMAND @CONFIG @CPATTR @CREATE @CRPLOG @DBCK
|
|
98 syntax keyword mushAtCommandList contained @DECOMPILE @DESTROY @DIG @DISABLE @DIVISION @DOING @DOLIST @DRAIN
|
|
99 syntax keyword mushAtCommandList contained @DUMP @EDIT @ELOCK @EMIT @EMPOWER @ENABLE @ENTRANCES @EUNLOCK @FIND
|
|
100 syntax keyword mushAtCommandList contained @FIRSTEXIT @FLAG @FORCE @FUNCTION @EDIT @GREP @HALT @HIDE @HOOK @KICK
|
|
101 syntax keyword mushAtCommandList contained @LEMIT @LEVEL @LINK @LIST @LISTMOTD @LOCK @LOG @LOGWIPE @LSET @MAIL @MALIAS
|
|
102 syntax keyword mushAtCommandList contained @MAP @MOTD @MVATTR @NAME @NEWPASSWORD @NOTIFY @NSCEMIT @NSEMIT @NSLEMIT
|
|
103 syntax keyword mushAtCommandList contained @NSOEMIT @NSPEMIT @NSPEMIT @NSREMIT @NSZEMIT @NUKE @OEMIT @OPEN @PARENT @PASSWORD
|
|
104 syntax keyword mushAtCommandList contained @PCREATE @PEMIT @POLL @POOR @POWERLEVEL @PROGRAM @PROMPT @PS @PURGE @QUOTA
|
|
105 syntax keyword mushAtCommandList contained @READCACHE @RECYCLE @REJECTMOTD @REMIT @RESTART @SCAN @SEARCH @SELECT @SET
|
|
106 syntax keyword mushAtCommandList contained @SHUTDOWN @SITELOCK @SNOOP @SQL @SQUOTA @STATS @SWITCH @SWEEP @SWITCH @TELEPORT
|
|
107 syntax keyword mushAtCommandList contained @TRIGGER @ULOCK @UNDESTROY @UNLINK @UNLOCK @UNRECYCLE @UPTIME @UUNLOCK @VERB
|
|
108 syntax keyword mushAtCommandList contained @VERSION @WAIT @WALL @WARNINGS @WCHECK @WHEREIS @WIPE @ZCLONE @ZEMIT
|
7
|
109 syntax match mushCommand "@\i\I*" contains=mushAtCommandList
|
|
110
|
|
111
|
557
|
112 syntax keyword mushCommand AHELP ANEWS ATTRIB_SET BRIEF BRIEF BUY CHANGES DESERT
|
|
113 syntax keyword mushCommand DISMISS DROP EMPTY ENTER EXAMINE FOLLOW GET GIVE GOTO
|
|
114 syntax keyword mushCommand HELP HUH_COMMAND INVENTORY INVENTORY LOOK LEAVE LOOK
|
|
115 syntax keyword mushCommand GOTO NEWS PAGE PAGE POSE RULES SAY SCORE SEMIPOSE
|
|
116 syntax keyword mushCommand SPECIALNEWS TAKE TEACH THINK UNFOLLOW USE WHISPER WHISPER
|
|
117 syntax keyword mushCommand WARN_ON_MISSING WHISPER WITH
|
7
|
118
|
|
119 syntax match mushSpecial "\*\|!\|=\|-\|\\\|+"
|
|
120 syntax match mushSpecial2 contained "\*"
|
|
121
|
557
|
122 syn region mushString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=mushSpecial,mushSpecial2,@Spell
|
|
123
|
|
124
|
7
|
125 syntax match mushIdentifier "&[^ ]\+"
|
|
126
|
|
127 syntax match mushVariable "%r\|%t\|%cr\|%[A-Za-z0-9]\+\|%#\|##\|here"
|
|
128
|
|
129 " numbers
|
|
130 syntax match mushNumber +[0-9]\++
|
|
131
|
|
132 " A comment line starts with a or # or " at the start of the line
|
|
133 " or an @@
|
|
134 syntax keyword mushTodo contained TODO FIXME XXX
|
557
|
135 syntax cluster mushCommentGroup contains=mushTodo
|
|
136 syntax match mushComment "^\s*@@.*$" contains=mushTodo
|
|
137 syntax match mushComment "^#[^define|^ifdef|^else|^pragma|^ifndef|^echo|^elif|^undef|^warning].*$" contains=mushTodo
|
|
138 syntax match mushComment "^#$" contains=mushTodo
|
|
139 syntax region mushComment matchgroup=mushCommentStart start="/@@" end="@@/" contains=@mushCommentGroup,mushCommentStartError,mushCommentString,@Spell
|
|
140 syntax region mushCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+@@/+me=s-1 contains=mushCommentSkip
|
|
141 syntax match mushCommentSkip contained "^\s*@@\($\|\s\+\)"
|
|
142
|
|
143
|
|
144 syntax match mushCommentStartError display "/@@"me=e-1 contained
|
|
145
|
|
146 " syntax match mushComment +^".*$+ contains=mushTodo
|
|
147 " Work on this one
|
|
148 " syntax match mushComment +^#.*$+ contains=mushTodo
|
|
149
|
|
150 syn region mushPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=mushComment
|
|
151 syn match mushPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
|
|
152
|
|
153 syn cluster mushPreProcGroup contains=mushPreCondit,mushIncluded,mushInclude,mushDefine,mushSpecial,mushString,mushCommentSkip,mushCommentString,@mushCommentGroup,mushCommentStartError
|
|
154
|
|
155 syn region mushIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
156 syn match mushIncluded display contained "<[^>]*>"
|
|
157 syn match mushInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=mushIncluded
|
|
158 syn region mushDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@mushPreProcGroup,@Spell
|
|
159 syn region mushPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@mushPreProcGroup
|
|
160
|
7
|
161
|
|
162 syntax region mushFuncBoundaries start="\[" end="\]" contains=mushFunction,mushFlag,mushAttributes,mushNumber,mushCommand,mushVariable,mushSpecial2
|
|
163
|
|
164 " FLAGS
|
|
165 syntax keyword mushFlag PLAYER ABODE BUILDER CHOWN_OK DARK FLOATING
|
|
166 syntax keyword mushFlag GOING HAVEN INHERIT JUMP_OK KEY LINK_OK MONITOR
|
|
167 syntax keyword mushFlag NOSPOOF OPAQUE QUIET STICKY TRACE UNFINDABLE VISUAL
|
|
168 syntax keyword mushFlag WIZARD PARENT_OK ZONE AUDIBLE CONNECTED DESTROY_OK
|
|
169 syntax keyword mushFlag ENTER_OK HALTED IMMORTAL LIGHT MYOPIC PUPPET TERSE
|
|
170 syntax keyword mushFlag ROBOT SAFE TRANSPARENT VERBOSE CONTROL_OK COMMANDS
|
|
171
|
|
172 syntax keyword mushAttribute aahear aclone aconnect adesc adfail adisconnect
|
|
173 syntax keyword mushAttribute adrop aefail aenter afail agfail ahear akill
|
|
174 syntax keyword mushAttribute aleave alfail alias amhear amove apay arfail
|
|
175 syntax keyword mushAttribute asucc atfail atport aufail ause away charges
|
|
176 syntax keyword mushAttribute cost desc dfail drop ealias efail enter fail
|
|
177 syntax keyword mushAttribute filter forwardlist gfail idesc idle infilter
|
|
178 syntax keyword mushAttribute inprefix kill lalias last lastsite leave lfail
|
|
179 syntax keyword mushAttribute listen move odesc odfail odrop oefail oenter
|
|
180 syntax keyword mushAttribute ofail ogfail okill oleave olfail omove opay
|
|
181 syntax keyword mushAttribute orfail osucc otfail otport oufail ouse oxenter
|
|
182 syntax keyword mushAttribute oxleave oxtport pay prefix reject rfail runout
|
|
183 syntax keyword mushAttribute semaphore sex startup succ tfail tport ufail
|
|
184 syntax keyword mushAttribute use va vb vc vd ve vf vg vh vi vj vk vl vm vn
|
|
185 syntax keyword mushAttribute vo vp vq vr vs vt vu vv vw vx vy vz
|
|
186
|
|
187
|
|
188 if version >= 508 || !exists("did_mush_syntax_inits")
|
|
189 if version < 508
|
|
190 let did_mush_syntax_inits = 1
|
|
191 command -nargs=+ HiLink hi link <args>
|
|
192 else
|
|
193 command -nargs=+ HiLink hi def link <args>
|
|
194 endif
|
|
195
|
|
196 " The default methods for highlighting. Can be overridden later
|
|
197 HiLink mushAttribute Constant
|
|
198 HiLink mushCommand Function
|
|
199 HiLink mushNumber Number
|
|
200 HiLink mushSetting PreProc
|
|
201 HiLink mushFunction Statement
|
|
202 HiLink mushVariable Identifier
|
|
203 HiLink mushSpecial Special
|
|
204 HiLink mushTodo Todo
|
|
205 HiLink mushFlag Special
|
|
206 HiLink mushIdentifier Identifier
|
557
|
207 HiLink mushDefine Macro
|
|
208 HiLink mushPreProc PreProc
|
|
209 HiLink mushPreProcGroup PreProc
|
|
210 HiLink mushPreCondit PreCondit
|
|
211 HiLink mushIncluded cString
|
|
212 HiLink mushInclude Include
|
|
213
|
|
214
|
|
215
|
|
216 " Comments
|
|
217 HiLink mushCommentStart mushComment
|
|
218 HiLink mushComment Comment
|
|
219 HiLink mushCommentString mushString
|
|
220
|
7
|
221
|
|
222 delcommand HiLink
|
|
223 endif
|
|
224
|
|
225 let b:current_syntax = "mush"
|
|
226
|
|
227 " mush: ts=17
|