xo-interpreter2 stack: refactor + bugfix operator expr

This commit is contained in:
Roland Conybeare 2026-03-12 20:26:08 -05:00
commit b69ec48d00
6 changed files with 164 additions and 31 deletions

View file

@ -14,21 +14,25 @@ namespace xo {
**/
class NumericPrimitives {
public:
/** polymorphic (in both arguments) multiply **/
static DPrimitive_gco_2_gco_gco s_mul_gco_gco_pm;
using AAllocator = xo::mm::AAllocator;
public:
/** polymorphic (in both arguments1) multiply **/
static DPrimitive_gco_2_gco_gco * make_multiply_pm(obj<AAllocator> mm);
/** polymorphic (in both arguments) divide **/
static DPrimitive_gco_2_gco_gco s_div_gco_gco_pm;
static DPrimitive_gco_2_gco_gco * make_divide_pm(obj<AAllocator> mm);
/** polymorphic (in both arguments) add **/
static DPrimitive_gco_2_gco_gco s_add_gco_gco_pm;
static DPrimitive_gco_2_gco_gco * make_add_pm(obj<AAllocator> mm);
/** polymorphic (in both arguments) subtract **/
static DPrimitive_gco_2_gco_gco s_sub_gco_gco_pm;
static DPrimitive_gco_2_gco_gco * make_subtract_pm(obj<AAllocator> mm);
/** polymorphic (in both arguments) compare (==) **/
static DPrimitive_gco_2_gco_gco s_cmpeq_gco_gco_pm;
static DPrimitive_gco_2_gco_gco * make_cmpeq_pm(obj<AAllocator> mm);
/** polymorphic (in both arguments) compare (!=) **/
static DPrimitive_gco_2_gco_gco s_cmpne_gco_gco_pm;
static DPrimitive_gco_2_gco_gco * make_cmpne_pm(obj<AAllocator> mm);
/** polymorphic (in both arguments) compare (<) **/
static DPrimitive_gco_2_gco_gco s_cmplt_gco_gco_pm;
static DPrimitive_gco_2_gco_gco * make_cmplt_pm(obj<AAllocator> mm);
};
}
}

View file

@ -0,0 +1,20 @@
/** @file numeric_register_primitives.hpp
*
* @author Roland Conybeare, Mar 2026
**/
#pragma once
#include "PrimitiveRegistry.hpp"
#include <xo/alloc2/Collector.hpp>
namespace xo {
namespace scm {
/** Register gc-aware (AGCObject,DRepr) combinations with garbage collector @p gc **/
bool numeric_register_primitives(obj<xo::mm::AAllocator> gc,
InstallSink sink,
InstallFlags flags);
}
}
/* end numeric_register_primitives.hpp */