From d90018ed10267dbf1f4c6f746b9f70460e1424a6 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 12 Oct 2021 14:54:22 +0200 Subject: Add Object struct and constructor functions --- src/bootstrap/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/bootstrap/main.c') 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 @@ +#include #include #include #include #include +#include #include "string_view.c" #include "read_line.c" #include "errors.c" #include "lexer.c" +#include "objects.c" + +void +init(void) { + // Initialize singletons. + obj_nil = alloc_object(OBJ_TYPE_NIL); + obj_true = alloc_object(OBJ_TYPE_BOOL); + obj_false = alloc_object(OBJ_TYPE_BOOL); +} void process_source(const StringView *source) { @@ -161,6 +172,8 @@ print_usage(void) { int main(int argc, char *argv[]) { + init(); + int option; while ((option = getopt(argc, argv, "i")) != -1) { switch (option) { -- cgit v1.2.1