From 2aef4f8884d96375a506f90fe163d90d6346b43c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 28 Oct 2009 18:38:33 -0400 Subject: Render an expr if expr_t::text() has no string --- src/expr.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/expr.cc') diff --git a/src/expr.cc b/src/expr.cc index 89214d51..4f12a648 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -78,6 +78,16 @@ expr_t::ptr_op_t expr_t::get_op() throw() return ptr; } +string expr_t::text() +{ + if (str.empty()) { + std::ostringstream out; + ptr->print(out); + set_text(out.str()); + } + return str; +} + expr_t& expr_t::operator=(const expr_t& _expr) { if (this != &_expr) { -- cgit v1.2.3