lang: ast: implement support for multiple expression terminator tokens
This commit is contained in:
@@ -37,7 +37,7 @@ struct token_parse_result parse_for(struct ivy_parser *ctx, struct ivy_token *to
|
||||
ctx, IVY_AST_EXPR, 0);
|
||||
|
||||
state->s_prev_token = IVY_KW_FOR;
|
||||
expr->s_terminator = IVY_KW_IN;
|
||||
expr_add_terminator(expr, IVY_KW_IN);
|
||||
expr->s_subexpr_depth = 1;
|
||||
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
@@ -68,7 +68,7 @@ static struct token_parse_result parse_in(
|
||||
|
||||
/* set the sub-expression depth to be non-zero so the expression parser doesn't consume the expression separator. */
|
||||
expr->s_subexpr_depth = 1;
|
||||
expr->s_terminator = IVY_KW_DO;
|
||||
expr_add_terminator(expr, IVY_KW_DO);
|
||||
|
||||
state->s_prev_token = IVY_KW_IN;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
|
||||
Reference in New Issue
Block a user