docs: reworked parser header to fully comply with the given grammar and added a language representation for each parse_* function
This commit is contained in:
parent
1fc54e2bf3
commit
346ad17e26
2 changed files with 73 additions and 22 deletions
|
|
@ -47,6 +47,11 @@ static bool is_end_of_list(struct token *token)
|
|||
|
||||
// === Functions
|
||||
|
||||
struct ast *parse_input(void)
|
||||
{
|
||||
return parse_list();
|
||||
}
|
||||
|
||||
/* Parses a simple list of words (command and arguments)
|
||||
* and returns the resulting ast
|
||||
*/
|
||||
|
|
@ -55,7 +60,7 @@ struct ast *parse_simple_command(void)
|
|||
struct list *command_elements = NULL;
|
||||
struct token *token = PEEK_TOKEN();
|
||||
|
||||
while (!isterminator(token))
|
||||
while (token->type == TOKEN_WORD)
|
||||
{
|
||||
token = POP_TOKEN();
|
||||
command_elements = list_append(command_elements, token->data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue