Refactored; added state property to command struct to notate where in the lifecycle of command processing that the command is.

This commit is contained in:
Aaron Traas 2018-12-05 09:40:09 -05:00
parent 9475552be4
commit 5f4df123b4
3 changed files with 107 additions and 82 deletions

2
misc.c
View file

@ -511,6 +511,7 @@ static void tokenize(char* raw, command_t *cmd)
/* populate command with parsed vocabulary metadata */
get_vocab_metadata(cmd->word[0].raw, &(cmd->word[0].id), &(cmd->word[0].type));
get_vocab_metadata(cmd->word[1].raw, &(cmd->word[1].id), &(cmd->word[1].type));
cmd->state = TOKENIZED;
}
bool get_command_input(command_t *command)
@ -551,6 +552,7 @@ bool get_command_input(command_t *command)
command->word[1].id);
#endif
command->state = GIVEN;
return true;
}