xo-reader2 stack: + xo-numeric + setup multi dispatch for *,/
This commit is contained in:
parent
3c20facb34
commit
a13e5efa61
2 changed files with 36 additions and 3 deletions
|
|
@ -9,6 +9,9 @@
|
|||
#include <xo/facet/FacetRegistry.hpp>
|
||||
#include <replxx.hxx>
|
||||
#include <iostream>
|
||||
#ifdef __APPLE__
|
||||
#include <unistd.h> // for STDIN_FILENO on OSX
|
||||
#endif
|
||||
|
||||
namespace xo {
|
||||
using xo::scm::VirtualSchematikaMachine;
|
||||
|
|
@ -85,7 +88,7 @@ namespace xo {
|
|||
|
||||
AppConfig(const ReplConfig & repl_cfg = ReplConfig(),
|
||||
const ArenaConfig & app_arena_cfg = ArenaConfig().with_name("skreplxx").with_size(16 * 1024),
|
||||
const VsmConfig & vsm_cfg = VsmConfig())
|
||||
const VsmConfig & vsm_cfg = VsmConfig())
|
||||
: repl_config_{repl_cfg}, app_arena_config_{app_arena_cfg}, vsm_config_{vsm_cfg}
|
||||
{
|
||||
//rdr_config_.reader_debug_flag_ = true;
|
||||
|
|
@ -239,4 +242,3 @@ main (int argc, char * argv[])
|
|||
} /*main*/
|
||||
|
||||
/* end skreplxx.cpp */
|
||||
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ namespace xo {
|
|||
};
|
||||
|
||||
aux_mm_.arena_.visit_pools(visitor);
|
||||
FacetRegistry::instance().visit_pools(visitor);
|
||||
TypeRegistry::instance().visit_pools(visitor);
|
||||
FacetRegistry::instance().visit_pools(visitor);
|
||||
vsm_.visit_pools(visitor);
|
||||
|
||||
return true;
|
||||
|
|
@ -189,6 +189,37 @@ namespace xo {
|
|||
log && vsm_fixture.log_memory_layout(&log);
|
||||
}
|
||||
|
||||
TEST_CASE("VirtualSchematikaMachine-arith2", "[interpreter2][VSM]")
|
||||
{
|
||||
const auto & testname = Catch::getResultCapture().getCurrentTestName();
|
||||
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag), xtag("test", testname));
|
||||
|
||||
VsmFixture vsm_fixture(testname, c_debug_flag);
|
||||
auto & vsm = vsm_fixture.vsm_;
|
||||
|
||||
bool eof_flag = false;
|
||||
|
||||
vsm.begin_interactive_session();
|
||||
VsmResultExt res = vsm.read_eval_print(span_type::from_cstr("3.14159265 / 0.5;"), eof_flag);
|
||||
|
||||
REQUIRE(res.is_value());
|
||||
REQUIRE(res.value());
|
||||
|
||||
log && log(xtag("res.tseq", res.value()->_typeseq()));
|
||||
|
||||
auto x = obj<AGCObject,DFloat>::from(*res.value());
|
||||
|
||||
REQUIRE(x);
|
||||
REQUIRE(x.data()->value() == 6.2831853);
|
||||
|
||||
REQUIRE(res.remaining_.size() == 1);
|
||||
REQUIRE(*res.remaining_.lo() == '\n');
|
||||
|
||||
log && vsm_fixture.log_memory_layout(&log);
|
||||
}
|
||||
|
||||
TEST_CASE("VirtualSchematikaMachine-cmp1", "[interpreter2][VSM]")
|
||||
{
|
||||
const auto & testname = Catch::getResultCapture().getCurrentTestName();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue