X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=blobdiff_plain;f=nucleus%2Flibrary%2Fnodes%2Fsymbol_tree.cpp;fp=nucleus%2Flibrary%2Fnodes%2Fsymbol_tree.cpp;h=bd985a27a1c883f6790849ff8b2ab9c65b5c5a2b;hp=947d4530463ea09978255639f9d77bf124db8b4f;hb=092bb1f6c64b3caf3d9b36577d0900fdf6c2af26;hpb=49d903f63b2681d0fd062a577c42a9d3678a3c08 diff --git a/nucleus/library/nodes/symbol_tree.cpp b/nucleus/library/nodes/symbol_tree.cpp index 947d4530..bd985a27 100644 --- a/nucleus/library/nodes/symbol_tree.cpp +++ b/nucleus/library/nodes/symbol_tree.cpp @@ -19,7 +19,7 @@ #include #include -#define DEBUG_SYMBOL_TREE +//#define DEBUG_SYMBOL_TREE // uncomment for totally noisy version. #include @@ -33,12 +33,14 @@ using namespace textual; namespace nodes { +//hmmm: used for... explain please. class symbol_tree_associations : public symbol_table { public: symbol_tree_associations(int estimated_elements) : symbol_table(estimated_elements) {} virtual ~symbol_tree_associations() { +//hmmm: why was this here? was it ever needed? // for (int i = 0; i < symbols(); i++) { // WHACK(use(i)); // } @@ -91,8 +93,12 @@ outcome symbol_tree::prune(tree *to_zap_in) FUNCDEF("prune"); #endif symbol_tree *to_zap = dynamic_cast(to_zap_in); - if (!to_zap) + if (!to_zap) { +#ifdef DEBUG_SYMBOL_TREE + LOG("about to barf due to null symtree after dynamic cast."); +#endif throw("error: symbol_tree::prune: wrong type of node in prune"); + } #ifdef DEBUG_SYMBOL_TREE LOG(astring("zapping node for ") + to_zap->name()); #endif