codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: MOO3" Maintainer: Timo Frenay <timo@frenay.net>4" Last Change: 2020 Oct 195" Note: Requires Vim 6.0 or above6 7" quit when a syntax file was already loaded8if exists("b:current_syntax")9 finish10endif11 12" Initializations13syn case ignore14 15" C-style comments16syn match mooUncommentedError display ~\*/~17syn match mooCStyleCommentError display ~/\ze\*~ contained18syn region mooCStyleComment matchgroup=mooComment start=~/\*~ end=~\*/~ contains=mooCStyleCommentError19 20" Statements21if exists("moo_extended_cstyle_comments")22 syn match mooIdentifier display ~\%(\%(/\*.\{-}\*/\s*\)*\)\@>\<\h\w*\>~ contained transparent contains=mooCStyleComment,@mooKeyword,mooType,mooVariable23else24 syn match mooIdentifier display ~\<\h\w*\>~ contained transparent contains=@mooKeyword,mooType,mooVariable25endif26syn keyword mooStatement break continue else elseif endfor endfork endif endtry endwhile finally for if try27syn keyword mooStatement except fork while nextgroup=mooIdentifier skipwhite28syn keyword mooStatement return nextgroup=mooString skipwhite29 30" Operators31syn keyword mooOperatorIn in32 33" Error constants34syn keyword mooAny ANY35syn keyword mooErrorConstant E_ARGS E_INVARG E_DIV E_FLOAT E_INVIND E_MAXREC E_NACC E_NONE E_PERM E_PROPNF E_QUOTA E_RANGE E_RECMOVE E_TYPE E_VARNF E_VERBNF36 37" Builtin variables38syn match mooType display ~\<\%(ERR\|FLOAT\|INT\|LIST\|NUM\|OBJ\|STR\)\>~39syn match mooVariable display ~\<\%(args\%(tr\)\=\|caller\|dobj\%(str\)\=\|iobj\%(str\)\=\|player\|prepstr\|this\|verb\)\>~40 41" Strings42syn match mooStringError display ~[^\t -[\]-~]~ contained43syn match mooStringSpecialChar display ~\\["\\]~ contained44if !exists("moo_no_regexp")45 " Regular expressions46 syn match mooRegexp display ~%%~ contained containedin=mooString,mooRegexpParentheses transparent contains=NONE47 syn region mooRegexpParentheses display matchgroup=mooRegexpOr start=~%(~ skip=~%%~ end=~%)~ contained containedin=mooString,mooRegexpParentheses transparent oneline48 syn match mooRegexpOr display ~%|~ contained containedin=mooString,mooRegexpParentheses49endif50if !exists("moo_no_pronoun_sub")51 " Pronoun substitutions52 syn match mooPronounSub display ~%%~ contained containedin=mooString transparent contains=NONE53 syn match mooPronounSub display ~%[#dilnopqrst]~ contained containedin=mooString54 syn match mooPronounSub display ~%\[#[dilnt]\]~ contained containedin=mooString55 syn match mooPronounSub display ~%(\h\w*)~ contained containedin=mooString56 syn match mooPronounSub display ~%\[[dilnt]\h\w*\]~ contained containedin=mooString57 syn match mooPronounSub display ~%<\%([dilnt]:\)\=\a\+>~ contained containedin=mooString58endif59if exists("moo_unmatched_quotes")60 syn region mooString matchgroup=mooStringError start=~"~ end=~$~ contains=@mooStringContents keepend61 syn region mooString start=~"~ skip=~\\.~ end=~"~ contains=@mooStringContents oneline keepend62else63 syn region mooString start=~"~ skip=~\\.~ end=~"\|$~ contains=@mooStringContents keepend64endif65 66" Numbers and object numbers67syn match mooNumber display ~\%(\%(\<\d\+\)\=\.\d\+\|\<\d\+\)\%(e[+\-]\=\d\+\)\=\>~68syn match mooObject display ~#-\=\d\+\>~69 70" Properties and verbs71if exists("moo_builtin_properties")72 "Builtin properties73 syn keyword mooBuiltinProperty contents f location name owner programmer r w wizard contained containedin=mooPropRef74endif75if exists("moo_extended_cstyle_comments")76 syn match mooPropRef display ~\.\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\h\w*\>~ transparent contains=mooCStyleComment,@mooKeyword77 syn match mooVerbRef display ~:\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\h\w*\>~ transparent contains=mooCStyleComment,@mooKeyword78else79 syn match mooPropRef display ~\.\s*\h\w*\>~ transparent contains=@mooKeyword80 syn match mooVerbRef display ~:\s*\h\w*\>~ transparent contains=@mooKeyword81endif82 83" Builtin functions, core properties and core verbs84if exists("moo_extended_cstyle_comments")85 syn match mooBuiltinFunction display ~\<\h\w*\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\ze(~ contains=mooCStyleComment86 syn match mooCorePropOrVerb display ~\$\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\%(in\>\)\@!\h\w*\>~ contains=mooCStyleComment,@mooKeyword87else88 syn match mooBuiltinFunction display ~\<\h\w*\s*\ze(~ contains=NONE89 syn match mooCorePropOrVerb display ~\$\s*\%(in\>\)\@!\h\w*\>~ contains=@mooKeyword90endif91if exists("moo_unknown_builtin_functions")92 syn match mooUnknownBuiltinFunction ~\<\h\w*\>~ contained containedin=mooBuiltinFunction contains=mooKnownBuiltinFunction93 " Known builtin functions as of version 1.8.1 of the server94 " Add your own extensions to this group if you like95 syn keyword mooKnownBuiltinFunction abs acos add_property add_verb asin atan binary_hash boot_player buffered_output_length callers caller_perms call_function ceil children chparent clear_property connected_players connected_seconds connection_name connection_option connection_options cos cosh create crypt ctime db_disk_size decode_binary delete_property delete_verb disassemble dump_database encode_binary equal eval exp floatstr floor flush_input force_input function_info idle_seconds index is_clear_property is_member is_player kill_task length listappend listdelete listen listeners listinsert listset log log10 match max max_object memory_usage min move notify object_bytes open_network_connection output_delimiters parent pass players properties property_info queued_tasks queue_info raise random read recycle renumber reset_max_object resume rindex rmatch seconds_left server_log server_version setadd setremove set_connection_option set_player_flag set_property_info set_task_perms set_verb_args set_verb_code set_verb_info shutdown sin sinh sqrt strcmp string_hash strsub substitute suspend tan tanh task_id task_stack ticks_left time tofloat toint toliteral tonum toobj tostr trunc typeof unlisten valid value_bytes value_hash verbs verb_args verb_code verb_info contained96endif97 98" Enclosed expressions99syn match mooUnenclosedError display ~[')\]|}]~100syn match mooParenthesesError display ~[';\]|}]~ contained101syn region mooParentheses start=~(~ end=~)~ transparent contains=@mooEnclosedContents,mooParenthesesError102syn match mooBracketsError display ~[');|}]~ contained103syn region mooBrackets start=~\[~ end=~\]~ transparent contains=@mooEnclosedContents,mooBracketsError104syn match mooBracesError display ~[');\]|]~ contained105syn region mooBraces start=~{~ end=~}~ transparent contains=@mooEnclosedContents,mooBracesError106syn match mooQuestionError display ~[');\]}]~ contained107syn region mooQuestion start=~?~ end=~|~ transparent contains=@mooEnclosedContents,mooQuestionError108syn match mooCatchError display ~[);\]|}]~ contained109syn region mooCatch matchgroup=mooExclamation start=~`~ end=~'~ transparent contains=@mooEnclosedContents,mooCatchError,mooExclamation110if exists("moo_extended_cstyle_comments")111 syn match mooExclamation display ~[\t !%&(*+,\-/<=>?@[^`{|]\@<!\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>!=\@!~ contained contains=mooCStyleComment112else113 syn match mooExclamation display ~[\t !%&(*+,\-/<=>?@[^`{|]\@<!\s*!=\@!~ contained114endif115 116" Comments117syn match mooCommentSpecialChar display ~\\["\\]~ contained transparent contains=NONE118syn match mooComment ~[\t !%&*+,\-/<=>?@^|]\@<!\s*"\([^\"]\|\\.\)*"\s*;~ contains=mooStringError,mooCommentSpecialChar119 120" Non-code121syn region mooNonCode start=~^\s*@\<~ end=~$~122syn match mooNonCode display ~^\.$~123syn match mooNonCode display ~^\s*\d\+:~he=e-1124 125" Overriding matches126syn match mooRangeOperator display ~\.\.~ transparent contains=NONE127syn match mooOrOperator display ~||~ transparent contains=NONE128if exists("moo_extended_cstyle_comments")129 syn match mooScattering ~[,{]\@<=\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>?~ transparent contains=mooCStyleComment130else131 syn match mooScattering ~[,{]\@<=\s*?~ transparent contains=NONE132endif133 134" Clusters135syn cluster mooKeyword contains=mooStatement,mooOperatorIn,mooAny,mooErrorConstant136syn cluster mooStringContents contains=mooStringError,mooStringSpecialChar137syn cluster mooEnclosedContents contains=TOP,mooUnenclosedError,mooComment,mooNonCode138 139" Define the default highlighting.140hi def link mooUncommentedError Error141hi def link mooCStyleCommentError Error142hi def link mooCStyleComment Comment143hi def link mooStatement Statement144hi def link mooOperatorIn Operator145hi def link mooAny Constant " link this to Keyword if you want146hi def link mooErrorConstant Constant147hi def link mooType Type148hi def link mooVariable Type149hi def link mooStringError Error150hi def link mooStringSpecialChar SpecialChar151hi def link mooRegexpOr SpecialChar152hi def link mooPronounSub SpecialChar153hi def link mooString String154hi def link mooNumber Number155hi def link mooObject Number156hi def link mooBuiltinProperty Type157hi def link mooBuiltinFunction Function158hi def link mooUnknownBuiltinFunction Error159hi def link mooKnownBuiltinFunction Function160hi def link mooCorePropOrVerb Identifier161hi def link mooUnenclosedError Error162hi def link mooParenthesesError Error163hi def link mooBracketsError Error164hi def link mooBracesError Error165hi def link mooQuestionError Error166hi def link mooCatchError Error167hi def link mooExclamation Exception168hi def link mooComment Comment169hi def link mooNonCode PreProc170 171let b:current_syntax = "moo"172 173" vim: ts=8174 