From 043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Mon, 18 Oct 2021 12:31:20 +0200 Subject: Add header files for all modules --- src/bootstrap/main.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/bootstrap/main.c') diff --git a/src/bootstrap/main.c b/src/bootstrap/main.c index 2d24f92..cfad9f1 100755 --- a/src/bootstrap/main.c +++ b/src/bootstrap/main.c @@ -6,25 +6,17 @@ #include #include -#include "string_view.c" -#include "read_line.c" +#include "singletons.c" + +#include "environment.c" #include "errors.c" +#include "gc.c" #include "lexer.c" #include "objects.c" #include "parser.c" -#include "environment.c" -#include "gc.c" #include "primitives.c" - -// -// Utility macros. -// - -#define MAKE_SYM(STR) make_symbol((StringView){(STR), sizeof(STR) - 1}) -#define MAKE_ENV_VAR(ENV,STR,VAR) \ - (env_add_symbol((ENV), MAKE_SYM(STR), (VAR))) -#define MAKE_ENV_PROC(ENV,STR,FUN) \ - (env_add_symbol((ENV), MAKE_SYM(STR), make_procedure(FUN))) +#include "read_line.c" +#include "string_view.c" void init(void) { @@ -113,7 +105,7 @@ process_source(const StringView *source) { .current = 0, }; while (has_next_token(&visitor) && peek_token(&visitor).type != TOKEN_EOF) { - // check the stack before parsing + // Check the root node stack size before parsing size_t root_stack_size = gc.roots.size; Object *root = parse_tree(&visitor); gc.roots.size = root_stack_size; -- cgit v1.2.1