Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " MUSHcode syntax file |
| 2 | " Maintainer: Bek Oberin <gossamer@tertius.net.au> |
| 3 | " Last updated by Rimnal on Mon Aug 20 08:28:56 MDT 2001 |
| 4 | |
| 5 | " For version 5.x: Clear all syntax items |
| 6 | " For version 6.x: Quit when a syntax file was already loaded |
| 7 | if version < 600 |
| 8 | syntax clear |
| 9 | elseif exists("b:current_syntax") |
| 10 | finish |
| 11 | endif |
| 12 | |
| 13 | |
| 14 | " regular mush functions |
| 15 | syntax keyword mushFunction contained abs acos add after and andflags aposs |
| 16 | syntax keyword mushFunction contained asin atan before capstr cat ceil center |
| 17 | syntax keyword mushFunction contained comp con conn controls convsecs convtime |
| 18 | syntax keyword mushFunction contained cos default delete dist2d dist3d div e |
| 19 | syntax keyword mushFunction contained edefault edit elements elock eq escape |
| 20 | syntax keyword mushFunction contained exit exp extract fdiv filter first flags |
| 21 | syntax keyword mushFunction contained floor fold foreach findable fullname get |
| 22 | syntax keyword mushFunction contained get_eval grab gt gte hasattr hasflag |
| 23 | syntax keyword mushFunction contained home idle index insert isdbref isnum |
| 24 | syntax keyword mushFunction contained isword iter last lattr lcon lcstr |
| 25 | syntax keyword mushFunction contained ldelete left lexits ljust ln lnum loc |
| 26 | syntax keyword mushFunction contained locate lock log lpos lt lte lwho map |
| 27 | syntax keyword mushFunction contained match matchall max member merge mid min |
| 28 | syntax keyword mushFunction contained mix mod money mudname mul munge name |
| 29 | syntax keyword mushFunction contained nearby neq next not num obj objeval |
| 30 | syntax keyword mushFunction contained objmem or orflags owner parent parse pi |
| 31 | syntax keyword mushFunction contained ports pos poss power r rand remove repeat |
| 32 | syntax keyword mushFunction contained replace rest reverse revwords right |
| 33 | syntax keyword mushFunction contained rjust rloc room round s scramble search |
| 34 | syntax keyword mushFunction contained secs secure setdiff setinter setq |
| 35 | syntax keyword mushFunction contained setunion shuffle sign sin sort sortby |
| 36 | syntax keyword mushFunction contained space splice sqrt squish starttime stats |
| 37 | syntax keyword mushFunction contained strlen strmatch sub subj switch tan time |
| 38 | syntax keyword mushFunction contained trim trunc type u ucstr udefault ulocal |
| 39 | syntax keyword mushFunction contained v version visible where wordpos words |
| 40 | syntax keyword mushFunction contained xcon xor |
| 41 | " only highligh functions when they have an in-bracket immediately after |
| 42 | syntax match mushFunctionBrackets "\i\I*(" contains=mushFunction |
| 43 | |
| 44 | " regular mush commands |
| 45 | syntax keyword mushAtCommandList contained @alias @chown @clone @create |
| 46 | syntax keyword mushAtCommandList contained @decompile @destroy @doing @dolist |
| 47 | syntax keyword mushAtCommandList contained @drain @edit @emit @entrances @femit |
| 48 | syntax keyword mushAtCommandList contained @force @fpose @fsay @halt @last |
| 49 | syntax keyword mushAtCommandList contained @link @list @listmotd @lock @mudwho |
| 50 | syntax keyword mushAtCommandList contained @mvattr @name @notify @oemit @parent |
| 51 | syntax keyword mushAtCommandList contained @password @pemit @ps @quota @robot |
| 52 | syntax keyword mushAtCommandList contained @search @set @stats @sweep @switch |
| 53 | syntax keyword mushAtCommandList contained @teleport @trigger @unlink @unlock |
| 54 | syntax keyword mushAtCommandList contained @verb @wait @wipe |
| 55 | syntax match mushCommand "@\i\I*" contains=mushAtCommandList |
| 56 | |
| 57 | |
| 58 | syntax keyword mushCommand drop enter examine get give goto help inventory |
| 59 | syntax keyword mushCommand kill leave look news page pose say score use |
| 60 | syntax keyword mushCommand version whisper DOING LOGOUT OUTPUTPREFIX |
| 61 | syntax keyword mushCommand OUTPUTSUFFIX QUIT SESSION WHO |
| 62 | |
| 63 | syntax match mushSpecial "\*\|!\|=\|-\|\\\|+" |
| 64 | syntax match mushSpecial2 contained "\*" |
| 65 | |
| 66 | syntax match mushIdentifier "&[^ ]\+" |
| 67 | |
| 68 | syntax match mushVariable "%r\|%t\|%cr\|%[A-Za-z0-9]\+\|%#\|##\|here" |
| 69 | |
| 70 | " numbers |
| 71 | syntax match mushNumber +[0-9]\++ |
| 72 | |
| 73 | " A comment line starts with a or # or " at the start of the line |
| 74 | " or an @@ |
| 75 | syntax keyword mushTodo contained TODO FIXME XXX |
| 76 | syntax match mushComment +^\s*@@.*$+ contains=mushTodo |
| 77 | syntax match mushComment +^".*$+ contains=mushTodo |
| 78 | syntax match mushComment +^#.*$+ contains=mushTodo |
| 79 | |
| 80 | syntax region mushFuncBoundaries start="\[" end="\]" contains=mushFunction,mushFlag,mushAttributes,mushNumber,mushCommand,mushVariable,mushSpecial2 |
| 81 | |
| 82 | " FLAGS |
| 83 | syntax keyword mushFlag PLAYER ABODE BUILDER CHOWN_OK DARK FLOATING |
| 84 | syntax keyword mushFlag GOING HAVEN INHERIT JUMP_OK KEY LINK_OK MONITOR |
| 85 | syntax keyword mushFlag NOSPOOF OPAQUE QUIET STICKY TRACE UNFINDABLE VISUAL |
| 86 | syntax keyword mushFlag WIZARD PARENT_OK ZONE AUDIBLE CONNECTED DESTROY_OK |
| 87 | syntax keyword mushFlag ENTER_OK HALTED IMMORTAL LIGHT MYOPIC PUPPET TERSE |
| 88 | syntax keyword mushFlag ROBOT SAFE TRANSPARENT VERBOSE CONTROL_OK COMMANDS |
| 89 | |
| 90 | syntax keyword mushAttribute aahear aclone aconnect adesc adfail adisconnect |
| 91 | syntax keyword mushAttribute adrop aefail aenter afail agfail ahear akill |
| 92 | syntax keyword mushAttribute aleave alfail alias amhear amove apay arfail |
| 93 | syntax keyword mushAttribute asucc atfail atport aufail ause away charges |
| 94 | syntax keyword mushAttribute cost desc dfail drop ealias efail enter fail |
| 95 | syntax keyword mushAttribute filter forwardlist gfail idesc idle infilter |
| 96 | syntax keyword mushAttribute inprefix kill lalias last lastsite leave lfail |
| 97 | syntax keyword mushAttribute listen move odesc odfail odrop oefail oenter |
| 98 | syntax keyword mushAttribute ofail ogfail okill oleave olfail omove opay |
| 99 | syntax keyword mushAttribute orfail osucc otfail otport oufail ouse oxenter |
| 100 | syntax keyword mushAttribute oxleave oxtport pay prefix reject rfail runout |
| 101 | syntax keyword mushAttribute semaphore sex startup succ tfail tport ufail |
| 102 | syntax keyword mushAttribute use va vb vc vd ve vf vg vh vi vj vk vl vm vn |
| 103 | syntax keyword mushAttribute vo vp vq vr vs vt vu vv vw vx vy vz |
| 104 | |
| 105 | |
| 106 | if version >= 508 || !exists("did_mush_syntax_inits") |
| 107 | if version < 508 |
| 108 | let did_mush_syntax_inits = 1 |
| 109 | command -nargs=+ HiLink hi link <args> |
| 110 | else |
| 111 | command -nargs=+ HiLink hi def link <args> |
| 112 | endif |
| 113 | |
| 114 | " The default methods for highlighting. Can be overridden later |
| 115 | HiLink mushAttribute Constant |
| 116 | HiLink mushCommand Function |
| 117 | HiLink mushComment Comment |
| 118 | HiLink mushNumber Number |
| 119 | HiLink mushSetting PreProc |
| 120 | HiLink mushFunction Statement |
| 121 | HiLink mushVariable Identifier |
| 122 | HiLink mushSpecial Special |
| 123 | HiLink mushTodo Todo |
| 124 | HiLink mushFlag Special |
| 125 | HiLink mushIdentifier Identifier |
| 126 | |
| 127 | delcommand HiLink |
| 128 | endif |
| 129 | |
| 130 | let b:current_syntax = "mush" |
| 131 | |
| 132 | " mush: ts=17 |