View/Edit #12:parse_folder_spec

Switch to edit mode.

Name(s): parse_folder_spec
1:  ":parse_folder_spec(verb,args,expected_preposition[,allow_trailing_args_p])"
2:  " => {folder, msg_seq_args, trailing_args}"
3:  set_task_perms(caller_perms())
4:  folder = this:current_folder()
5:  if (!prepstr)
6:    return {folder, args[2], {}}
7:  endif
8:  {verb, args, prep, ?extra = 0} = args
9:  p = prepstr in args
10: if (prepstr != prep)
11:   "...unexpected preposition..."
12:   if (extra && !index(prepstr, " "))
13:     return {folder, args[1..p - 1], args[p..length(args)]}
14:   else
15:     player:tell("Usage:  ", verb, " [<message numbers>] [", prep, " <folder/list-name>]")
16:   endif
17: elseif (!(p < length(args) && (fname = args[p + 1])))
18:   "...preposition but no iobj..."
19:   player:tell(verb, " ", $string_utils:from_list(args, " "), " WHAT?")
20: elseif ($mail_agent:match_failed(folder = typeof(m = $mail_agent:match_recipient(fname)) == $LIST ? m[1] | m, fname))
21:   "...bogus mail folder..."
22: else
23:   return {folder, args[1..p - 1], args[p + 2..length(args)]}
24: endif
25: return 0
26: "Last modified by Dax (#789) on Tue May  3 13:55:52 2005 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]