Parse sentence

来自MudWiki

语法

   mixed parse_sentence(string, void | int, void | object *, void | mapping);

描述

   This efun calls the driver parser and tells it to parse and execute the command contained in the given string. The efun may return an integer error code, or a string error message. If a string message is returned, it should be displayed to the player. The integer codes are:

   * 1: command has been processed ok
   * 0: no matching command was found, no processing done
   * -1: A matching command was found but none of its rules were matched.
   * -2: A rule made sense but all "can" or "direct" applies returned 0.

   * Parsing package changes:
       . parse_sentence has an optional 3rd and 4th arg.
       . The 3rd arg an array of objects to use in the parse instead of the inventory of the environment of the user.  Nested arrays indicate containment, i.e. ({ ob1, ({ object inside ob1 }), ob2, ob3, ({ first ob in ob3, second ob in ob3 }), ... })
       . The 4th argument is a mapping of string -> object which can be used to supply nicknames and similar things.  For this parse, the 'object' acts as if 'string' were returned by pc_id_list(). Entries that do not correspond to objects involved in the current parse are ignored.

参考

   add_action(3)