From 002ed247934384de40337fff32b39b3dcf4a5458 Mon Sep 17 00:00:00 2001 From: Himbeer Date: Tue, 1 Oct 2024 18:55:39 +0200 Subject: Attach (optional) labels to blocks rather than loops This makes it possible to return values from any block by breaking out of it, enabling if statements to yield expressions when combined with commit ce68792c848caee2f184e7a6392d9f1e958da1a1. --- include/parse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/parse.h') diff --git a/include/parse.h b/include/parse.h index ff5e3f1..21584cc 100644 --- a/include/parse.h +++ b/include/parse.h @@ -19,6 +19,7 @@ struct ast_param { }; struct ast_block { + const char *label; struct ast_cmd *cmds; int cmdsz, cmdlen; }; @@ -92,7 +93,6 @@ struct ast_if { }; struct ast_for { - const char *label; struct ast_assign *init, *action; struct ast_expr cond; struct ast_block blk; -- cgit v1.2.3