summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-16 16:06:19 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-16 16:06:19 -0400
commit35459f4ef5c9076a331acecd0c16328326c4081b (patch)
tree9432b6c6664db1c89e6d8995a9e07cceb960b7e0 /types.h
parent8e5455bb58956031658caab650f0a162fc471508 (diff)
switched to labels for break/continue so that switch works in the future
Diffstat (limited to 'types.h')
-rw-r--r--types.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/types.h b/types.h
index a9c2268..20eb28b 100644
--- a/types.h
+++ b/types.h
@@ -501,6 +501,9 @@ enum {
typedef U8 BlockFlags;
typedef struct Block {
BlockFlags flags;
+ struct {
+ IdentID break_lbl, cont_lbl; /* initially 0, set to non-zero values if needed (++g->lbl_counter); set by sdecls_cgen. */
+ } c;
Location where;
Identifiers idents;
struct Statement *stmts;
@@ -974,7 +977,7 @@ typedef struct Statement {
Return ret;
Include inc;
Message message; /* #error, #warn, #info */
- Block *referring_to; /* for break/continue */
+ Block *referring_to; /* for break/continue; set during typing */
};
} Statement;
@@ -1038,7 +1041,7 @@ typedef struct Typer {
typedef struct CGenerator {
Allocator *allocr;
FILE *outc;
- IdentID ident_counter;
+ IdentID ident_counter, lbl_counter;
int indent_lvl; /* how many levels of indentation? */
bool will_indent; /* will the next thing be indented? */
ParsedFile *file;