Merge remote-tracking branch 'origin/exec-unset' into dev
This commit is contained in:
commit
08cc18bd21
2 changed files with 4 additions and 4 deletions
|
|
@ -76,7 +76,7 @@ static void set_token_keyword(struct token *tok, char *begin, ssize_t size)
|
||||||
tok->type = TOKEN_FOR;
|
tok->type = TOKEN_FOR;
|
||||||
else if (strncmp(begin, "while", size) == 0 && size == 5)
|
else if (strncmp(begin, "while", size) == 0 && size == 5)
|
||||||
tok->type = TOKEN_WHILE;
|
tok->type = TOKEN_WHILE;
|
||||||
else if (strncmp(begin, "until", size) == 0 && size == 4)
|
else if (strncmp(begin, "until", size) == 0 && size == 5)
|
||||||
tok->type = TOKEN_UNTIL;
|
tok->type = TOKEN_UNTIL;
|
||||||
else if (strncmp(begin, "do", size) == 0 && size == 2)
|
else if (strncmp(begin, "do", size) == 0 && size == 2)
|
||||||
tok->type = TOKEN_DO;
|
tok->type = TOKEN_DO;
|
||||||
|
|
|
||||||
|
|
@ -220,18 +220,18 @@ struct ast *parse_while(struct lexer_context *ctx)
|
||||||
}
|
}
|
||||||
POP_TOKEN();
|
POP_TOKEN();
|
||||||
|
|
||||||
return parse_loop(ctx, true);
|
return parse_loop(ctx, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ast *parse_until(struct lexer_context *ctx)
|
struct ast *parse_until(struct lexer_context *ctx)
|
||||||
{
|
{
|
||||||
struct token *token = PEEK_TOKEN();
|
struct token *token = PEEK_TOKEN();
|
||||||
|
|
||||||
// 'while'
|
// 'until'
|
||||||
if (token->type != TOKEN_UNTIL)
|
if (token->type != TOKEN_UNTIL)
|
||||||
{
|
{
|
||||||
perror(
|
perror(
|
||||||
"Internal error: expected a TOKEN_WHILE but got a different type");
|
"Internal error: expected a TOKEN_UNTIL but got a different type");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
POP_TOKEN();
|
POP_TOKEN();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue