diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-05-23 12:40:21 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-05-23 12:40:21 -0400 |
| commit | fba2b99b65d5023675a3f270adbc87ef0b0ede8f (patch) | |
| tree | c1af45c5b80c9813a48fcc25386f331786004c73 /compile.c | |
| parent | 7a741e65e663d9ce9013691d2479c6fdba4b798b (diff) | |
Support 'while when'
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -623,7 +623,7 @@ CORD compile_statement(env_t *env, ast_t *ast) CORD body = compile_statement(scope, while_->body); if (loop_ctx.skip_label) body = CORD_all(body, "\n", loop_ctx.skip_label, ": continue;"); - CORD loop = CORD_all("while (", compile(scope, while_->condition), ") {\n\t", body, "\n}"); + CORD loop = CORD_all("while (", while_->condition ? compile(scope, while_->condition) : "yes", ") {\n\t", body, "\n}"); if (loop_ctx.stop_label) loop = CORD_all(loop, "\n", loop_ctx.stop_label, ":;"); return loop; |
