]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
print_tree prints the object addresses
[ginac.git] / ginac / basic.cpp
index 725f28a2e6b0ea40965ebbc45d50e6ca9d5e7a98..b86900795d950c542bf5f0dc9e281c6c4063fc4e 100644 (file)
@@ -68,7 +68,7 @@ const basic & basic::operator=(const basic & other)
                // The other object is of a derived class, so clear the flags as they
                // might no longer apply (especially hash_calculated). Oh, and don't
                // copy the tinfo_key: it is already set correctly for this object.
-               flags = 0;
+               fl &= ~(status_flags::evaluated | status_flags::expanded | status_flags::hash_calculated);
        } else {
                // The objects are of the exact same class, so copy the hash value.
                hashvalue = other.hashvalue;
@@ -140,11 +140,9 @@ void basic::print_dispatch(const registered_class_info & ri, const print_context
        const print_context_class_info * pc_info = &c.get_class_info();
 
 next_class:
-std::clog << "searching class " << reg_info->options.get_name() << std::endl;
        const std::vector<print_functor> & pdt = reg_info->options.get_print_dispatch_table();
 
 next_context:
-std::clog << "searching context " << pc_info->options.get_name() << ", ID " << pc_info->options.get_id() << std::endl;
        unsigned id = pc_info->options.get_id();
        if (id >= pdt.size() || !(pdt[id].is_valid())) {
 
@@ -173,8 +171,6 @@ std::clog << "searching context " << pc_info->options.get_name() << ", ID " << p
        } else {
 
                // Call method
-std::clog << "method found, calling" << std::endl;
-std::clog << " this = " << class_name() << ", context = " << c.class_name() << std::endl;
                pdt[id](*this, c, level);
        }
 }
@@ -188,10 +184,11 @@ void basic::do_print(const print_context & c, unsigned level) const
 /** Tree output to stream. */
 void basic::do_print_tree(const print_tree & c, unsigned level) const
 {
-       c.s << std::string(level, ' ') << class_name()
-           << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
-           << ", nops=" << nops()
-           << std::endl;
+       c.s << std::string(level, ' ') << class_name() << " @" << this
+           << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec;
+       if (nops())
+               c.s << ", nops=" << nops();
+       c.s << std::endl;
        for (size_t i=0; i<nops(); ++i)
                op(i).print(c, level + c.delta_indent);
 }