lang: ast: implement support for multiple expression terminator tokens
This commit is contained in:
@@ -12,7 +12,7 @@ struct token_parse_result stmt_parse_for(
|
||||
struct expr_parser_state *state
|
||||
= parser_get_state(ctx, struct expr_parser_state);
|
||||
|
||||
if (state->s_terminator == IVY_KW_FOR) {
|
||||
if (expr_terminates_at_token(state, IVY_KW_FOR)) {
|
||||
/* treat this as a statement terminator. */
|
||||
struct token_parse_result result = expr_finalise_and_return(ctx, state);
|
||||
result.r_flags |= PARSE_REPEAT_TOKEN;
|
||||
@@ -126,7 +126,7 @@ struct token_parse_result stmt_parse_if(
|
||||
struct expr_parser_state *state
|
||||
= parser_get_state(ctx, struct expr_parser_state);
|
||||
|
||||
if (state->s_terminator == IVY_KW_IF) {
|
||||
if (expr_terminates_at_token(state, IVY_KW_IF)) {
|
||||
/* treat this as a statement terminator. */
|
||||
struct token_parse_result result = expr_finalise_and_return(ctx, state);
|
||||
result.r_flags |= PARSE_REPEAT_TOKEN;
|
||||
|
||||
Reference in New Issue
Block a user