fix/refactor: Modified evaluate and changed it to evaluate_tree
So i did what the last commit said, also fixed parse_expr because it was still using malloc for allocating new nodes so i made it use arena_alloc like it should, did the very first tests so it's all good, i think is readdy to merge.
This commit is contained in:
@@ -23,9 +23,7 @@ int main(void) {
|
||||
tokenize(buf, &context);
|
||||
|
||||
ParseResult par = parse(&context);
|
||||
AST tree = par.tree;
|
||||
int64_t result = evaluate(tree.head);
|
||||
arena_destroy(par.arena);
|
||||
int64_t result = evaluate(par);
|
||||
|
||||
|
||||
printf("El resultado es: %" PRIi64 "\n", result);
|
||||
|
||||
Reference in New Issue
Block a user