From 5cdaf3e3facec8c67dcf18db9ff4c64612667dc7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 15 Mar 2024 13:35:30 -0400 Subject: Fancy skip/stop implementation --- environment.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'environment.h') diff --git a/environment.h b/environment.h index 8abc889a..6defc631 100644 --- a/environment.h +++ b/environment.h @@ -20,13 +20,20 @@ typedef struct { type_t *return_type; table_t *closure_scope; table_t *closed_vars; -} fn_context_t; +} fn_ctx_t; + +typedef struct loop_ctx_s { + struct loop_ctx_s *next; + const char *key_name, *value_name; + CORD skip_label, stop_label; +} loop_ctx_t; typedef struct { table_t *types, *globals, *locals; table_t *type_namespaces; // Map of type name -> namespace table compilation_unit_t *code; - fn_context_t *fn_ctx; + fn_ctx_t *fn_ctx; + loop_ctx_t *loop_ctx; CORD scope_prefix; } env_t; -- cgit v1.2.3