xo-expression: minor print logging fixes

This commit is contained in:
Roland Conybeare 2024-08-28 00:57:17 -04:00
commit 24d9d504b5
2 changed files with 13 additions and 7 deletions

View file

@ -18,9 +18,12 @@ namespace xo {
void
Variable::display(std::ostream & os) const {
os << "<Variable"
<< xtag("name", name_)
<< xtag("type", this->valuetype()->short_name())
<< ">";
<< xtag("name", name_);
if (this->valuetype())
os << xtag("type", this->valuetype()->short_name());
else
os << xtag("type", "nullptr");
os << ">";
} /*display*/
} /*namespace ast*/
} /*namespace xo*/