From 6caae2ff991e589a10a8b265367441385b64b0e0 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 20 Jan 2026 16:54:27 -0500 Subject: [PATCH] xo-reader2: streamline DDefineExpr printing using xo::print::cond --- src/expression2/DDefineExpr.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/expression2/DDefineExpr.cpp b/src/expression2/DDefineExpr.cpp index 83ee9188..c8785415 100644 --- a/src/expression2/DDefineExpr.cpp +++ b/src/expression2/DDefineExpr.cpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace xo { using xo::print::APrintable; @@ -73,21 +74,11 @@ namespace xo { auto rhs = FacetRegistry::instance().try_variant(rhs_); - if (rhs_) { - assert(rhs); - - return ppii.pps()->pretty_struct - (ppii, - "DDefineExpr", - refrtag("lhs", lhs), - refrtag("rhs", rhs)); - } else { - return ppii.pps()->pretty_struct - (ppii, - "DDefineExpr", - refrtag("lhs", lhs), - refrtag("rhs", "nullptr")); - } + return ppii.pps()->pretty_struct + (ppii, + "DDefineExpr", + refrtag("lhs", lhs), + refrtag("rhs", cond(rhs_, rhs, "nullptr"))); } } /*namespace scm*/