moo.core.parse.Lexer
- class moo.core.parse.Lexer(command)
An instance of this class will identify the various parts of a imperative sentence. This may be of use to verb code, as well.
- __init__(command)
Methods
__init__(command)Attributes
The full, unparsed command string the player typed.
The tokenised words from the command, preserving quoted spans.
The direct-object substring, or
Noneif the command had no direct object.Any specifier on the direct object (
my,the, a possessive likeBill's).Dict mapping each preposition that appeared in the command to a list of
[spec_str, obj_str, obj]triples.