diff --git a/pub/lib/expr.cpp b/pub/lib/expr.cpp index bb016db032b1ff512960ed0e7d2d4566dcc5b504..91a7681847bcb9a4a08f24f83a59be73a51f685a 100644 --- a/pub/lib/expr.cpp +++ b/pub/lib/expr.cpp @@ -198,6 +198,8 @@ string CRef3::ref_info() const int CNode::tree_val_idx( const CContext& ctx, const string& name ) const { + cout << "DEBUG tvi:\n"; + cout << tree_info() << "\n"; RObj val = tree_val( ctx ); RObjInt pi = PCAST<const CObjInt>(val); if ( !pi ) diff --git a/pub/lib/node.cpp b/pub/lib/node.cpp index 3e1d5af524b46afe578ba20f6bd2833cdb471995..bcabf6eece318464e34e5f01faffc3b061df342f 100644 --- a/pub/lib/node.cpp +++ b/pub/lib/node.cpp @@ -701,7 +701,7 @@ CCoord CNodeVal::node_coord( int k ) const string CNodeVal::tree_info() const { - return "val[" + val->to_s() + "]"; + return "val(" + val->to_s() + ")"; } @@ -884,9 +884,13 @@ RObj CNodeCurveR2::curve_val_scalar( const CCurve * c ) const RObj CNodePoint::tree_val( const CContext& ctx ) const { + cout << "DEBUG tv: " << tree_info() << "\n"; auto ref3 = PCAST<const CRef3>(ref); if( !ref3 ) throw S("BUG: NodePoint has no Ref3"); + cout << "DEBUG tv: ref3: " << ref3->ref_info() << "\n"; + cout << "DEBUG tv: ref3: tk: " << ref3->tk->tree_info() << "\n"; + cout << "DEBUG tv: ref3: ti: " << ref3->ti->tree_info() << "\n"; if ( ctx.dim==CContext::_VI ) { if ( ref->k_depends_on_i() || ref3->j_depends_on_i() ) { if ( ctx.nv<0 ) diff --git a/pub/lib/obj.cpp b/pub/lib/obj.cpp index d63f748a8d338faef0bac0d82fbc1f5020f43057..65d41740d5352efccb69398b8a71a2cc003c10ea 100644 --- a/pub/lib/obj.cpp +++ b/pub/lib/obj.cpp @@ -7,10 +7,9 @@ //! \file obj.cpp //! \brief Data containers: CObj and its children. -#include "defs.hpp" - #include <boost/format.hpp> - +#include "../trivia/string_ops.hpp" +#include "defs.hpp" #include "ptr.hpp" #include "obj.hpp" @@ -37,7 +36,7 @@ string CObjInt::to_s( int maxlen, int minlen, int prec ) const { // TODO: respect minlen string form = str( format( "%%#%ii" ) % maxlen ); - string ret = str( format( form ) % val ); + string ret = triv::strip( str( format( form ) % val ) ); return ret; } @@ -52,7 +51,7 @@ string CObjDbl::to_s( int maxlen, int minlen, int prec ) const { // TODO: respect minlen string form = str( format( "%%#%i.%ig" ) % maxlen % prec ); - string ret = str( format( form ) % val ); + string ret = triv::strip( str( format( form ) % val ) ); return ret; }