diff options
Diffstat (limited to 'src/bootstrap/main.c')
-rwxr-xr-x | src/bootstrap/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bootstrap/main.c b/src/bootstrap/main.c index dadc887..7323629 100755 --- a/src/bootstrap/main.c +++ b/src/bootstrap/main.c | |||
@@ -1,12 +1,23 @@ | |||
1 | #include <assert.h> | ||
1 | #include <getopt.h> | 2 | #include <getopt.h> |
2 | #include <stdbool.h> | 3 | #include <stdbool.h> |
3 | #include <stdio.h> | 4 | #include <stdio.h> |
4 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | #include <string.h> | ||
5 | 7 | ||
6 | #include "string_view.c" | 8 | #include "string_view.c" |
7 | #include "read_line.c" | 9 | #include "read_line.c" |
8 | #include "errors.c" | 10 | #include "errors.c" |
9 | #include "lexer.c" | 11 | #include "lexer.c" |
12 | #include "objects.c" | ||
13 | |||
14 | void | ||
15 | init(void) { | ||
16 | // Initialize singletons. | ||
17 | obj_nil = alloc_object(OBJ_TYPE_NIL); | ||
18 | obj_true = alloc_object(OBJ_TYPE_BOOL); | ||
19 | obj_false = alloc_object(OBJ_TYPE_BOOL); | ||
20 | } | ||
10 | 21 | ||
11 | void | 22 | void |
12 | process_source(const StringView *source) { | 23 | process_source(const StringView *source) { |
@@ -161,6 +172,8 @@ print_usage(void) { | |||
161 | 172 | ||
162 | int | 173 | int |
163 | main(int argc, char *argv[]) { | 174 | main(int argc, char *argv[]) { |
175 | init(); | ||
176 | |||
164 | int option; | 177 | int option; |
165 | while ((option = getopt(argc, argv, "i")) != -1) { | 178 | while ((option = getopt(argc, argv, "i")) != -1) { |
166 | switch (option) { | 179 | switch (option) { |