xo-interpreter2 stack: + nth() primitive

This commit is contained in:
Roland Conybeare 2026-03-11 15:40:38 -05:00
commit 31c32cbca7
3 changed files with 60 additions and 2 deletions

View file

@ -1401,6 +1401,44 @@ namespace xo {
log && fixture.log_memory_layout(&log);
}
TEST_CASE("SchematikaParser-batch-qlist2", "[reader2][SchematikaParser]")
{
// top-level recursive function definition
const auto & testname = Catch::getResultCapture().getCurrentTestName();
constexpr bool c_debug_flag = false;
scope log(XO_DEBUG(c_debug_flag), xtag("test", testname));
ParserFixture fixture(testname, c_debug_flag);
auto & parser = *(fixture.parser_);
parser.begin_interactive_session();
/** Walkthrough parsing input equivalent to:
*
* #q{ (4 7.2) };
* ^ ^ ^^ ^ ^ ^^
* 0 1 2| 4 5 6|
* 3 7
**/
std::vector<Token> tk_v{
/* [ 0] */ Token::quote_token(),
/* [ 1] */ Token::leftbrace_token(),
/* [ 2] */ Token::leftparen_token(),
/* [ 3] */ Token::i64_token("4"),
/* [ 4] */ Token::f64_token("7.2"),
/* [ 5] */ Token::rightparen_token(),
/* [ 6] */ Token::rightbrace_token(),
/* [ 7] */ Token::semicolon_token(),
};
utest_tokenizer_loop(&parser, tk_v, c_debug_flag);
log && fixture.log_memory_layout(&log);
}
TEST_CASE("SchematikaParser-batch-qarray", "[reader2][SchematikaParser]")
{
// top-level recursive function definition