Syntax parser¶
This class helps with the parsing of a single BaseMessage using its header
and optionally its body content (for MessageData). A syntax describes how
positional and keyword values are extracted to a dictionary that can then be used as
the base values to build a Reply or an Event.
- class aiostem.utils.syntax.ReplySyntax[source]¶
Describe the syntax of a single reply item.
Important
-
flags:
ReplySyntaxFlag¶ List of parsing flags.
-
flags:
- class aiostem.utils.syntax.ReplySyntaxFlag[source]¶
Bases:
IntFlagAll accepted flags for a reply syntax item.
- POS_REMAIN = 1¶
Capture everything remaining in the last positional argument.
- KW_ENABLE = 16¶
Enable the parsing of keyword arguments.
- KW_QUOTED = 32¶
Whether the keyword value can be enclosed with quotes.
- KW_EXTRA = 64¶
Whether we preserve unknown keyword arguments.
- KW_OMIT_KEYS = 128¶
Keyword arguments can omit their key.
- KW_OMIT_VALS = 256¶
Keyword arguments can omit their value.
- KW_USE_DATA = 512¶
Use data from
MessageDataas a potential KW value.
- KW_RAW = 1024¶
No quoting or escape is performed (whole line is a value).