From 96b2dc234f38934599fc9ca5e34e9269c4bcb5bd Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 18 Feb 2018 19:42:54 -0800 Subject: [PATCH] Remove currently unused node types from the tree code. --- include/tree.h | 12 +----------- src/tree.c | 10 +++------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/include/tree.h b/include/tree.h index 5e4204b..d457f27 100644 --- a/include/tree.h +++ b/include/tree.h @@ -11,21 +11,11 @@ enum libab_tree_variant_e { NONE, BASE, ID, - STR, - CHAR, NUM, - BOOL, - KW, OP, UNARY_OP, BLOCK, - FUN, - IF, - WHILE, - DOWHILE, - FOR, - CALL, - RETURN + IF }; /** diff --git a/src/tree.c b/src/tree.c index 41a1540..c0e0d00 100644 --- a/src/tree.c +++ b/src/tree.c @@ -4,10 +4,7 @@ int _tree_has_vector(libab_tree* tree) { return tree->variant == BASE || tree->variant == OP || tree->variant == UNARY_OP || tree->variant == BLOCK || - tree->variant == FUN || tree->variant == IF || - tree->variant == WHILE || tree->variant == DOWHILE || - tree->variant == FOR || tree->variant == CALL || - tree->variant == RETURN; + tree->variant == IF; } void libab_tree_free(libab_tree* tree) { @@ -16,9 +13,8 @@ void libab_tree_free(libab_tree* tree) { if(_tree_has_vector(tree)) { free_vector = 1; } - if(tree->variant == ID || tree->variant == STR || tree->variant == NUM || - tree->variant == KW || tree->variant == OP || tree->variant == UNARY_OP || - tree->variant == FUN || tree->variant == CALL) { + if(tree->variant == ID || tree->variant == NUM || + tree->variant == OP || tree->variant == UNARY_OP) { free_string = 1; } if(free_string) free(tree->string_value);