From ecf425fb9aa12a0f3dd08d23bcd74919fb11b362 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Mar 2024 13:28:30 -0400 Subject: Rearrange expression/statement compilation code --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index 68be4026..676e09f2 100644 --- a/parse.c +++ b/parse.c @@ -815,7 +815,7 @@ ast_t *parse_for_suffix(parse_ctx_t *ctx, ast_t *lhs) { if (match_word(&pos, "if")) { ast_t *condition = expect(ctx, pos-2, &pos, parse_expr, "I expected a condition for this 'if'"); body = NewAST(ctx->file, body->start, condition->end, Block, - .statements=new(ast_list_t, .ast=WrapAST(condition, If, .condition=condition, .else_body=FakeAST(Skip)), + .statements=new(ast_list_t, .ast=WrapAST(condition, If, .condition=FakeAST(Not, condition), .body=FakeAST(Skip)), .next=new(ast_list_t, .ast=body))); } return NewAST(ctx->file, start, pos, For, .index=index, .value=value, .iter=iter, .body=body); -- cgit v1.2.3