config parser: recover after invalid input

This is done by ignoring the rest of the current line and jumping to the
nearest <error> token.

fixes #879
This commit is contained in:
Michael Stapelberg
2012-11-20 17:09:03 +01:00
parent 6148136e7c
commit 3cb909fa62
5 changed files with 100 additions and 4 deletions

View File

@ -190,6 +190,7 @@ static void next_state(const cmdp_token *token) {
subcommand_output.json_gen = command_output.json_gen;
subcommand_output.needs_tree_render = false;
GENERATED_call(token->extra.call_identifier, &subcommand_output);
state = subcommand_output.next_state;
/* If any subcommand requires a tree_render(), we need to make the
* whole parser result request a tree_render(). */
if (subcommand_output.needs_tree_render)