xo-reader: wip: parsing lambda expressions [wip, non-functional]

This commit is contained in:
Roland Conybeare 2024-08-17 01:09:17 -04:00
commit 0841fd7dbd
10 changed files with 289 additions and 5 deletions

View file

@ -4,8 +4,10 @@
*/
#include "expect_expr_xs.hpp"
#include "lambda_xs.hpp"
#include "paren_xs.hpp"
#include "progress_xs.hpp"
#include "xo/expression/Lambda.hpp"
#include "xo/expression/Constant.hpp"
namespace xo {
@ -23,6 +25,22 @@ namespace xo {
: exprstate(exprstatetype::expect_rhs_expression)
{}
void
expect_expr_xs::on_lambda_token(const token_type & tk,
exprstatestack * p_stack,
rp<Expression> * p_emit_expr)
{
constexpr bool c_debug_flag = true;
scope log(XO_DEBUG(c_debug_flag));
//constexpr const char * self_name = "exprstate::on_leftparen";
/* push lparen_0 to remember to look for subsequent rightparen. */
p_stack->push_exprstate(lambda_xs::make());
p_stack->top_exprstate().on_lambda_token(tk, p_stack, p_emit_expr);
//p_stack->push_exprstate(expect_expr_xs::expect_rhs_expression());
}
void
expect_expr_xs::on_leftparen_token(const token_type & /*tk*/,
exprstatestack * p_stack,