blob: 9e4bc947b7ef9df5ee5ea345f80230d55f241d4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/* Includes all of toc's files */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <inttypes.h>
#include <stdbool.h>
#include <float.h>
#include "types.h"
static Type *type_user_underlying(Type *t) {
assert(t->kind == 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;
}
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 "rand.c"
#include "location.c"
#include "err.c"
#include "allocator.c"
#include "arr.c"
#include "blockarr.c"
#include "str.c"
#include "hash_tables.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
|