Skip to content
Snippets Groups Projects
Commit 256b244c authored by dgelessus's avatar dgelessus
Browse files

Separate command parsing into splitting and validation steps

The splitting step splits the argument string into separate arguments
according to a Parameters object, and associates the split arguments
with the corresponding parameters. However, it performs absolutely no
checking - splitArgs will split any input string without errors.
(Any excess arguments that cannot be associated with a parameter are
returned as a separate string.)

The validation step takes the output of the splitting step and
validates it against the Parameters object. Currently this only
involves checking that there is no excess input and validating argument
count constraints.

This separation will make it easier to work with potentially incomplete
or invalid command arguments, which is necessary for the completion and
inspection features. It also makes the parsing code a little more
organized.

For now this change is purely internal to the command parsing code.
The external API of Parameters and related classes has not changed
(although they may be changed in the future).
parent 1abbb271
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment