xo-reader: work on apply expression parsing
This commit is contained in:
parent
93b2daab6c
commit
190a21e2f7
4 changed files with 16 additions and 3 deletions
|
|
@ -107,6 +107,7 @@ namespace xo {
|
|||
|
||||
if (this->applyxs_type_ == applyexprstatetype::apply_3) {
|
||||
this->applyxs_type_ = applyexprstatetype::apply_2;
|
||||
expect_expr_xs::start(p_psm);
|
||||
} else {
|
||||
constexpr const char * c_self_name = "apply_xs::on_comma_token";
|
||||
const char * exp = this->get_expect_str();
|
||||
|
|
@ -125,6 +126,7 @@ namespace xo {
|
|||
|
||||
if (this->applyxs_type_ == applyexprstatetype::apply_1) {
|
||||
this->applyxs_type_ = applyexprstatetype::apply_2;
|
||||
expect_expr_xs::start(p_psm);
|
||||
} else {
|
||||
constexpr const char * c_self_name = "apply_xs::on_leftparen_token";
|
||||
const char * exp = this->get_expect_str();
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ namespace xo {
|
|||
{
|
||||
scope log(XO_DEBUG(p_psm->debug_flag()));
|
||||
|
||||
log && log("defxs_type", defxs_type_);
|
||||
log && log(xtag("defxs_type", defxs_type_), xtag("env_stack_size", p_psm->env_stack_size()));
|
||||
|
||||
if (this->defxs_type_ == defexprstatetype::def_1) {
|
||||
this->defxs_type_ = defexprstatetype::def_2;
|
||||
|
|
@ -178,7 +178,7 @@ namespace xo {
|
|||
// For interactive top-level defs we want to evaluate as we go,
|
||||
// so need incremental bindings.
|
||||
|
||||
if (p_psm->env_stack_size() == 2) {
|
||||
if (p_psm->env_stack_size() == 1) {
|
||||
/* remember variable binding in lexical context,
|
||||
* so we can refer to it later
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace xo {
|
|||
|
||||
/* stack_ is non-empty */
|
||||
|
||||
log && log(xtag("top", psm_.xs_stack_.top_exprstate()));
|
||||
log && log(xrefrtag("top", psm_.xs_stack_.top_exprstate()));
|
||||
|
||||
psm_.xs_stack_.top_exprstate().on_input(tk, &psm_);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue