View/Edit #12:my_match

Switch to edit mode.

Name(s): my_match
1:  "Decides, from the point-of-view of `who', which of the following `visible' objects `string' matches"
2:  {string, objects, ?who = this} = args
3:  all = 0
4:  if (parsed = $match_utils:parse_all_reference(string))
5:    string = parsed
6:    all = 1
7:  endif
8:  objects = $list_utils:remove_duplicates(objects)
9:  m = {}
10: if (string in $msg.me)
11:   m = {who}
12: elseif (string in $msg.here)
13:   m = {who.location}
14: elseif (matches = $match_utils:match_absolute(string))
15:   m = matches
16: elseif (matches = $match_utils:match_all(string, objects))
17:   m = matches
18: elseif ((parsed = $match_utils:parse_ordinal_reference(string)) && (matches = {$match_utils:match_nth(parsed[2], objects, parsed[1])}))
19:   m = matches
20: elseif (parsed = $match_utils:parse_possessive_reference(string))
21:   {whostr, objstr} = parsed
22:   if (valid(who = this:my_match(whostr, objects, this)))
23:     return who:match(objstr, this)
24:   endif
25: endif
26: if (m == {})
27:   return $failed_match
28: elseif (all)
29:   return m
30: elseif (length(m) > 1)
31:   return $ambiguous_match
32: else
33:   return m[1]
34: endif
35: "Last modified by manta (#7165) on Mon Nov 12 10:55:13 2001 MST."
36: "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:04 2002 MDT)."
37: "Last modified by Dax (#789) on Sat Aug 17 14:50:04 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]