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