lang: ast: add support for multiple block termination tokens
This commit is contained in:
@@ -70,7 +70,7 @@ static struct token_parse_result parse_do(
|
||||
= (struct block_parser_state *)parser_push_state(
|
||||
ctx, IVY_AST_BLOCK, 0);
|
||||
/* set the sub-expression depth to be non-zero so the expression parser doesn't consume the expression separator. */
|
||||
block->s_terminator = IVY_KW_END;
|
||||
block_add_terminator(block, IVY_KW_END);
|
||||
|
||||
state->s_prev_token = IVY_KW_DO;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
@@ -90,7 +90,7 @@ static struct token_parse_result parse_expr_begin(
|
||||
struct block_parser_state *block
|
||||
= (struct block_parser_state *)parser_push_state(
|
||||
ctx, IVY_AST_BLOCK, 0);
|
||||
block->s_terminator = IVY_KW_END;
|
||||
block_add_terminator(block, IVY_KW_END);
|
||||
return PARSE_RESULT(IVY_OK, PARSE_REPEAT_TOKEN);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user