xo-parser: simplify: exprstate::on_symbol drop retval
This commit is contained in:
parent
129b5d9258
commit
77ec1c7ead
2 changed files with 10 additions and 8 deletions
|
|
@ -233,9 +233,9 @@ namespace xo {
|
|||
|
||||
private:
|
||||
void on_def(exprstatestack * p_stack);
|
||||
expraction on_symbol(const token_type & tk,
|
||||
exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr);
|
||||
void on_symbol(const token_type & tk,
|
||||
exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr);
|
||||
void on_colon(exprstatestack * p_stack);
|
||||
void on_singleassign(exprstatestack * p_stack);
|
||||
void on_f64(const token_type & tk,
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ namespace xo {
|
|||
*/
|
||||
}
|
||||
|
||||
expraction
|
||||
void
|
||||
exprstate::on_symbol(const token_type & tk,
|
||||
exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr)
|
||||
|
|
@ -306,16 +306,17 @@ namespace xo {
|
|||
case exprstatetype::def_4:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return expraction();
|
||||
return;
|
||||
|
||||
case exprstatetype::expect_rhs_expression:
|
||||
case exprstatetype::expect_symbol:
|
||||
/* have to do pop first */
|
||||
|
||||
p_stack->pop_exprstate();
|
||||
return p_stack->top_exprstate().on_exprir
|
||||
p_stack->top_exprstate().on_exprir
|
||||
(exprir(exprirtype::symbol, tk.text()), p_stack, p_emit_expr);
|
||||
//return expraction::pop(exprir(exprirtype::symbol, tk.text()));
|
||||
return;
|
||||
|
||||
case exprstatetype::expect_type: {
|
||||
TypeDescr td = nullptr;
|
||||
|
|
@ -342,16 +343,17 @@ namespace xo {
|
|||
}
|
||||
|
||||
p_stack->pop_exprstate();
|
||||
return p_stack->top_exprstate().on_exprir
|
||||
p_stack->top_exprstate().on_exprir
|
||||
(exprir(exprirtype::typedescr, td), p_stack, p_emit_expr);
|
||||
//return expraction::pop(exprir(exprirtype::typedescr, td));
|
||||
return;
|
||||
}
|
||||
|
||||
case exprstatetype::invalid:
|
||||
case exprstatetype::n_exprstatetype:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return expraction();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue