diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-14 13:28:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-14 13:28:30 -0400 |
| commit | ecf425fb9aa12a0f3dd08d23bcd74919fb11b362 (patch) | |
| tree | 7ea113b9e33623c8be4b54196df4d438d360c285 /parse.c | |
| parent | d5d3f564bbc716d2a9f3d534c97d3baff77dda59 (diff) | |
Rearrange expression/statement compilation code
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |
