xo-reader2 xo-expression2: define example working and printing

def foo : f64 = 3.141593;
This commit is contained in:
Roland Conybeare 2026-01-22 18:40:42 -05:00
commit 2bf23b41a9
12 changed files with 206 additions and 10 deletions

View file

@ -79,11 +79,21 @@ namespace xo {
auto rhs = FacetRegistry::instance().try_variant<APrintable,
AExpression>(rhs_);
return ppii.pps()->pretty_struct
(ppii,
"DDefineExpr",
refrtag("lhs", lhs),
refrtag("rhs", cond(rhs_, rhs, "nullptr")));
// note: xo::print::cond() doesn't resolve the way we want here
if (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));
}
}
} /*namespace scm*/