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;
|
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)
|
expr_t& expr_t::operator=(const expr_t& _expr)
|
||||||
{
|
{
|
||||||
if (this != &_expr) {
|
if (this != &_expr) {
|
||||||
|
|
|
||||||
|
|
@ -116,10 +116,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr_op_t get_op() throw();
|
ptr_op_t get_op() throw();
|
||||||
|
string text();
|
||||||
string text() const throw() {
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This has special use in the textual parser
|
// This has special use in the textual parser
|
||||||
void set_text(const string& txt) {
|
void set_text(const string& txt) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue