From deeb6aa4aa60e22190087a9615447e742c84a19c Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Thu, 16 Feb 2023 19:24:20 -0800 Subject: added scoping and a lot of memory leaks --- src/scope.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/scope.c') diff --git a/src/scope.c b/src/scope.c index afb9d5c..f2b9f79 100644 --- a/src/scope.c +++ b/src/scope.c @@ -1,20 +1,3 @@ #include #include "scope.h" #include "hashtable.h" - -scope_t* init_scope(scope_t parent) { - scope_t* scope = malloc(sizeof(scope_t)); - scope->hashtable = init_hashtable(1000); - *(scope->parent) = parent; - return scope; -} -pair_t* get_pair_global(scope_t* scope, char* key) { - while (scope->parent != NULL) { - pair_t* pair = hashtable_get_pair(scope->hashtable, key); - if (pair != NULL) { - return pair; - } - scope = scope->parent; - } - return NULL; -} -- cgit v1.3.1