-
Notifications
You must be signed in to change notification settings - Fork 0
Inputs
Jonathan edited this page Oct 25, 2020
·
1 revision
KWCommands separates command processing into some tasks, the first one is Command Parsing, where KWCommands takes the string input and create tokens from it, these tokes are called Inputs
, there are four types of Inputs:
- SingleInput
- Represents a single parsed value, such as
register
,invoke
,call
- Represents a single parsed value, such as
- ListInput
- Represents a collection of parsed values, such as
[hello, world]
, or['name', 'email']
- Represents a collection of parsed values, such as
- MapInput
- Represents a collection of parsed key-value pairs, such as
{name='KWCommands',description='Command parsing, completion and dispatch library'}
.
- Represents a collection of parsed key-value pairs, such as
- EmptyInput
- Represents an empty input, this is used during parsing process to signal absence of an Input, or in errors when Input fails to be parsed, so it is transformed into an EmptyInput which only contains the entire string trying to be parsed. This also could be used in Completion to signal absence of completion candidates.
They represent types of Inputs:
- AnyInputType
- Special InputType which represent a match to any value in input, there is no Input backing this type, but is commonly represented by SingleInput.
- SingleInputType
- Type representing SingleInput
- ListInputType
- Type representing ListInput
- MapInputType
- Type representing MapInput
- EmptyInputType
- Type representing EmptyInput
Please, read the Parsing section to understand the parsing of Command Line String.