From 24d9d504b513f23cdc25bd8fe3354786c7b375c8 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 28 Aug 2024 00:57:17 -0400 Subject: [PATCH] xo-expression: minor print logging fixes --- include/xo/expression/Constant.hpp | 11 +++++++---- src/expression/Variable.cpp | 9 ++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) 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*/