diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-01 21:29:05 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-01 21:29:05 -0500 |
commit | ae47cf5b2c8991e21f0445a34f6960afa3f25e4e (patch) | |
tree | 0d3fa64cc0f52d69905dc655ffc0c8f48903b823 /types.h | |
parent | 6ecf77104d061b2035d490c23e45cc5b1a1a0235 (diff) |
more namespaces
Diffstat (limited to 'types.h')
-rw-r--r-- | types.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -474,7 +474,8 @@ typedef struct StructDef { enum { BLOCK_IS_FN = 0x01, - BLOCK_FOUND_TYPES = 0x02, + BLOCK_IS_NMS = 0x02, + BLOCK_FOUND_TYPES = 0x04 }; typedef struct Block { U8 flags; @@ -698,6 +699,10 @@ const char *const builtin_val_names[BUILTIN_VAL_COUNT] = typedef struct Namespace { Block body; Identifiers idents; /* these do not include local variables */ + Identifier associated_ident; /* if this is foo ::= nms { ... }, then associated_ident is foo; can be NULL */ + struct { + IdentID id; /* used as prefix is associated_ident is unavailable */ + } c; } Namespace; enum { @@ -911,6 +916,7 @@ typedef struct CGenerator { Evaluator *evalr; Identifier main_ident; Identifiers *idents; + char *nms_prefix; /* dynamic (null-terminated) array of characters, the current namespace C prefix (e.g. "foo__bar__") */ } CGenerator; #ifdef TOC_DEBUG |