aboutsummaryrefslogtreecommitdiff
path: root/src/checker/checker.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-04 16:16:17 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-04 16:16:17 +0100
commitc2e3c3801acd8af32fcf6ea3ad2d3a2ddc94c870 (patch)
tree4686866a14b65f9d9c4a37567c8593f7951b1881 /src/checker/checker.cpp
parentcdd8eadda172b3ced7a774dfa1f22a976b3bdb7f (diff)
Type match statement for tagged unions
Diffstat (limited to 'src/checker/checker.cpp')
-rw-r--r--src/checker/checker.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/checker/checker.cpp b/src/checker/checker.cpp
index 8c95281fc..04b68eb9b 100644
--- a/src/checker/checker.cpp
+++ b/src/checker/checker.cpp
@@ -197,12 +197,13 @@ struct CheckerContext {
// NOTE(bill): Symbol tables
struct CheckerInfo {
- Map<TypeAndValue> types; // Key: AstNode * | Expression -> Type (and value)
- Map<Entity *> definitions; // Key: AstNode * | Identifier -> Entity
- Map<Entity *> uses; // Key: AstNode * | Identifier -> Entity
- Map<Scope *> scopes; // Key: AstNode * | Node -> Scope
- Map<ExpressionInfo> untyped; // Key: AstNode * | Expression -> ExpressionInfo
- Map<DeclInfo *> entities; // Key: Entity *
+ Map<TypeAndValue> types; // Key: AstNode * | Expression -> Type (and value)
+ Map<Entity *> definitions; // Key: AstNode * | Identifier -> Entity
+ Map<Entity *> uses; // Key: AstNode * | Identifier -> Entity
+ Map<Scope *> scopes; // Key: AstNode * | Node -> Scope
+ Map<ExpressionInfo> untyped; // Key: AstNode * | Expression -> ExpressionInfo
+ Map<DeclInfo *> entities; // Key: Entity *
+ Map<Entity *> foreign_procs; // Key: String
};
struct Checker {
@@ -424,12 +425,13 @@ void init_universal_scope(void) {
void init_checker_info(CheckerInfo *i) {
gbAllocator a = gb_heap_allocator();
- map_init(&i->types, a);
- map_init(&i->definitions, a);
- map_init(&i->uses, a);
- map_init(&i->scopes, a);
- map_init(&i->entities, a);
- map_init(&i->untyped, a);
+ map_init(&i->types, a);
+ map_init(&i->definitions, a);
+ map_init(&i->uses, a);
+ map_init(&i->scopes, a);
+ map_init(&i->entities, a);
+ map_init(&i->untyped, a);
+ map_init(&i->foreign_procs, a);
}
@@ -440,6 +442,7 @@ void destroy_checker_info(CheckerInfo *i) {
map_destroy(&i->scopes);
map_destroy(&i->entities);
map_destroy(&i->untyped);
+ map_destroy(&i->foreign_procs);
}