From 337e8a20abb50fb462756a5bec9e907aa02e70e6 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 5 Apr 2015 12:43:11 +0100 Subject: [PATCH] Continued adding "--skeleton" switch. Fixed backtracking in deriving-input-data-from-DFA algorithm. --- re2c/code.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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; } -- 2.40.0