Skip to content
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
  • ListInput
    • Represents a collection of parsed values, such as [hello, world], or ['name', 'email']
  • MapInput
    • Represents a collection of parsed key-value pairs, such as {name='KWCommands',description='Command parsing, completion and dispatch library'}.
  • 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.

InputTypes

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

Parsing

Please, read the Parsing section to understand the parsing of Command Line String.

Clone this wiki locally