diff --git a/include/xo/expression/Constant.hpp b/include/xo/expression/Constant.hpp index 77098a5b..b2c9f71d 100644 --- a/include/xo/expression/Constant.hpp +++ b/include/xo/expression/Constant.hpp @@ -66,10 +66,13 @@ namespace xo { } virtual void display(std::ostream & os) const override { - os << "short_name()) - << xtag("value", value_) - << ">"; + os << "short_name()); + else + os << xtag("type", "nullptr");; + os << xtag("value", value_); + os << ">"; } private: diff --git a/src/expression/Variable.cpp b/src/expression/Variable.cpp index 766e0c67..18434afb 100644 --- a/src/expression/Variable.cpp +++ b/src/expression/Variable.cpp @@ -18,9 +18,12 @@ namespace xo { void Variable::display(std::ostream & os) const { os << "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*/