From: Ulya Trofimovich Date: Sun, 5 Apr 2015 11:43:11 +0000 (+0100) Subject: Continued adding "--skeleton" switch. X-Git-Tag: 0.15~318 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=337e8a20abb50fb462756a5bec9e907aa02e70e6;p=re2c Continued adding "--skeleton" switch. Fixed backtracking in deriving-input-data-from-DFA algorithm. --- diff --git a/re2c/code.cc b/re2c/code.cc index c479db26..7e5e739b 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -1136,17 +1136,11 @@ static void generate_data (State * s, bool def, const std::vectorgenerated) - { - s->generated = true; - generate_data (s->go.span[0].to, s->go.span[0].is_default, xs, ys); - } - break; case Action::MATCH: case Action::ENTER: case Action::INITIAL: case Action::SAVE: + case Action::MOVE: if (!s->generated) { s->generated = true; @@ -1156,11 +1150,15 @@ static void generate_data (State * s, bool def, const std::vector z (xs[j]); - z.push_back (s->go.span[i].ub - 1); + if (s->go.span[i].to->action->type != Action::MOVE) + { + z.push_back (s->go.span[i].ub - 1); + } zs.push_back (z); } generate_data (s->go.span[i].to, s->go.span[i].is_default, zs, ys); } + s->generated = false; } break; }