xo-reader: simplify f64 token handling

This commit is contained in:
Roland Conybeare 2024-08-09 20:28:58 -04:00
commit b8b9efd633
7 changed files with 40 additions and 36 deletions

View file

@ -4,8 +4,12 @@
*/
#include "expect_expr_xs.hpp"
#include "progress_xs.hpp"
#include "xo/expression/Constant.hpp"
namespace xo {
using xo::ast::Constant;
namespace scm {
std::unique_ptr<expect_expr_xs>
@ -18,6 +22,26 @@ namespace xo {
: exprstate(exprstatetype::expect_rhs_expression)
{}
void
expect_expr_xs::on_f64_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_f64_token";
/* e.g.
* def pi = 3.14159265;
* \---tk---/
*/
p_stack->push_exprstate
(progress_xs::make
(Constant<double>::make(tk.f64_value())));
}
} /*namespace scm*/
} /*namespace xo*/