git subrepo clone git@github.com:Rconybea/xo-interpreter.git xo-interpreter

subrepo:
  subdir:   "xo-interpreter"
  merged:   "047658a5"
upstream:
  origin:   "git@github.com:Rconybea/xo-interpreter.git"
  branch:   "main"
  commit:   "047658a5"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
This commit is contained in:
Roland Conybeare 2026-06-06 22:12:50 -04:00
commit 9eaae04fdf
39 changed files with 3222 additions and 0 deletions

View file

@ -0,0 +1,59 @@
/** @file ExpressionBoxed.cpp
*
* @author Roland Conybeare, Nov 2025
**/
#include "ExpressionBoxed.hpp"
#include "xo/reflect/Reflect.hpp"
namespace xo {
using xo::reflect::Reflect;
using xo::reflect::TaggedPtr;
namespace scm {
ExpressionBoxed::ExpressionBoxed(bp<Expression> c) : contents_{c.promote()}
{}
gp<ExpressionBoxed>
ExpressionBoxed::make(gc::IAlloc * mm,
bp<Expression> c)
{
return new (MMPtr(mm)) ExpressionBoxed(c);
}
TaggedPtr
ExpressionBoxed::self_tp() const
{
return Reflect::make_tp(const_cast<ExpressionBoxed *>(this));
}
void
ExpressionBoxed::display(std::ostream & os) const
{
os << contents_;
}
std::size_t
ExpressionBoxed::_shallow_size() const
{
return sizeof(ExpressionBoxed);
}
Object *
ExpressionBoxed::_shallow_copy(gc::IAlloc * mm) const
{
Cpof cpof(mm, this);
return new (cpof) ExpressionBoxed(*this);
}
std::size_t
ExpressionBoxed::_forward_children(gc::IAlloc *)
{
return _shallow_size();
}
} /*namespace scm*/
} /*namespace xo*/
/* end ExpressionBoxed.cpp */