}
}
+static std::string output_yych (bool & readCh)
+{
+ if (readCh)
+ {
+ readCh = false;
+ return "(" + input_api.expr_peek_save () + ")";
+ }
+ else
+ {
+ return mapCodeName["yych"];
+ }
+}
+
static void genSwitch(OutputFile & o, uint ind, const State *from, const State *next, bool &readCh, Span * sp, uint nsp)
{
if (nsp <= 2)
}
else
{
- if (readCh)
- {
- o << indent(ind) << "switch ((" << input_api.expr_peek_save () << ")) {\n";
- readCh = false;
- }
- else
- {
- o << indent(ind) << "switch (" << mapCodeName["yych"] << ") {\n";
- }
+ o << indent(ind) << "switch (" << output_yych (readCh) << ") {\n";
Cases cases (sp, nsp);
for (uint i = 0; i < cases.size (); ++i)
static std::string genGotoProlog (OutputFile & o, uint ind, const State *from, const State *next, bool &readCh, Span * sp, uint nsp)
{
- std::string sYych = readCh
- ? "(" + input_api.expr_peek_save () + ")"
- : mapCodeName["yych"];
- readCh = false;
+ std::string sYych = output_yych (readCh);
if (nsp > 0)
{