xo-interpreter2 stack: + literal array parsing

This commit is contained in:
Roland Conybeare 2026-03-03 12:12:09 +11:00
commit 680416d077
18 changed files with 812 additions and 51 deletions

View file

@ -1287,7 +1287,7 @@ namespace xo {
const auto & testname = Catch::getResultCapture().getCurrentTestName();
constexpr bool c_debug_flag = true;
constexpr bool c_debug_flag = false;
scope log(XO_DEBUG(c_debug_flag), xtag("test", testname));
ParserFixture fixture(testname, c_debug_flag);
@ -1319,6 +1319,44 @@ namespace xo {
log && fixture.log_memory_layout(&log);
}
TEST_CASE("SchematikaParser-batch-qarray", "[reader2][SchematikaParser]")
{
// top-level recursive function definition
const auto & testname = Catch::getResultCapture().getCurrentTestName();
constexpr bool c_debug_flag = true;
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.5 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::leftbracket_token(),
/* [ 3] */ Token::f64_token("4.5"),
/* [ 4] */ Token::f64_token("7.2"),
/* [ 5] */ Token::rightbracket_token(),
/* [ 6] */ Token::rightbrace_token(),
/* [ 7] */ Token::semicolon_token(),
};
utest_tokenizer_loop(&parser, tk_v, c_debug_flag);
log && fixture.log_memory_layout(&log);
}
} /*namespace ut*/
} /*namespace xo*/