diff options
Diffstat (limited to 'src/context.c')
-rw-r--r-- | src/context.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/context.c b/src/context.c index c0898d8..ff0291a 100644 --- a/src/context.c +++ b/src/context.c @@ -1,6 +1,10 @@ +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> + #include <context.h> -#include <lib.h> #include <tokenize.h> +#include <treeify.h> struct ctx *context_create(const char *path) { @@ -24,6 +28,9 @@ struct ctx *context_create(const char *path) ctx->raw[ctx->size] = 0; + ctx->tree.head = tree_create(); + ctx->tree.current = NULL; + return ctx; } @@ -41,6 +48,9 @@ void context_destroy(struct ctx *ctx) if (ctx->tokens) free(ctx->tokens); + if (ctx->tree.head) + tree_destroy(ctx->tree.head); + free(ctx); } |