static void apply(const pegtl::input& in, MacroLineState& state) { // printf("Number %s\n", in.string().c_str()); auto& nodes = state.loops.size() ? state.loops.back().nodes : state.env.nodes; nodes.push_back({std::stof(in.string()), state.delta}); state.delta = false; }
static void apply(const pegtl::input& in, MacroLineState& state) { // printf("LoopCount %s\n", in.string().c_str()); state.loops.push_back({ std::stoi(in.string()) }); }
static void apply(const pegtl::input& in, MacroLineState& state) { state.name = in.string(); }
static void apply(const pegtl::input& in, std::vector<double>& out) { out.push_back(std::stod(in.string())); }