diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-28 18:38:33 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-28 18:38:33 -0400 |
commit | 2aef4f8884d96375a506f90fe163d90d6346b43c (patch) | |
tree | b8ab51fcc823613b95902c353f471c2afee1197f /src/expr.cc | |
parent | 1c9c3ad411356ac45e9c25b6d21331b3c4d14174 (diff) | |
download | fork-ledger-2aef4f8884d96375a506f90fe163d90d6346b43c.tar.gz fork-ledger-2aef4f8884d96375a506f90fe163d90d6346b43c.tar.bz2 fork-ledger-2aef4f8884d96375a506f90fe163d90d6346b43c.zip |
Render an expr if expr_t::text() has no string
Diffstat (limited to 'src/expr.cc')
-rw-r--r-- | src/expr.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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) { |