Render an expr if expr_t::text() has no string
This commit is contained in:
parent
1c9c3ad411
commit
2aef4f8884
2 changed files with 11 additions and 4 deletions
10
src/expr.cc
10
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) {
|
||||
|
|
|
|||
|
|
@ -116,10 +116,7 @@ public:
|
|||
}
|
||||
|
||||
ptr_op_t get_op() throw();
|
||||
|
||||
string text() const throw() {
|
||||
return str;
|
||||
}
|
||||
string text();
|
||||
|
||||
// This has special use in the textual parser
|
||||
void set_text(const string& txt) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue