/* Includes all of toc's files */ #include #include #include #include #include #include #include #include #include #include #include #include "types.h" /* can be used on TYPE_USERs and TYPE_CALLs */ static Type *type_user_underlying(Type *t) { assert(t->flags & TYPE_IS_RESOLVED); switch (t->kind) { case TYPE_USER: { Declaration *d = t->user.decl; assert(d->flags & DECL_FOUND_VAL); return (d->type.kind == TYPE_TUPLE ? d->val.tuple[t->user.index] : d->val).type; } case TYPE_CALL: return &t->call.instance->type; default: assert(0); } } static Type *type_inner(Type *t) { assert(t->flags & TYPE_IS_RESOLVED); while (t->kind == TYPE_USER) { t = type_user_underlying(t); } return t; } #include "allocator.c" #include "arr.c" #include "location.c" #include "err.c" #include "rand.c" #include "blockarr.c" #include "str.c" #include "instance_table.c" #include "copy.c" #include "identifiers.c" #include "tokenizer.c" #include "parse.c" #include "scope.c" #include "eval.c" #include "types.c" static bool cgen_decls_file(CGenerator *g, ParsedFile *f); static bool typedefs_file(CGenerator *g, ParsedFile *f); #include "cgen.c" #include "typedefs_cgen.c" #include "decls_cgen.c" #ifdef TOC_DEBUG #include "tests.c" #endif