xo-interpreter2 stack: parse literal lists (w/ implicit types)

This commit is contained in:
Roland Conybeare 2026-03-02 23:21:10 +11:00
commit f2a9aa3f52
19 changed files with 1052 additions and 99 deletions

View file

@ -1209,7 +1209,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);
@ -1244,7 +1244,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);
@ -1281,6 +1281,44 @@ namespace xo {
log && fixture.log_memory_layout(&log);
}
TEST_CASE("SchematikaParser-batch-qlist", "[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::leftparen_token(),
/* [ 3] */ Token::f64_token("4.5"),
/* [ 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);
}
} /*namespace ut*/
} /*namespace xo*/