From 261353ba77ce640a26e98d6854e7b194371036d8 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 6 Apr 2015 19:08:02 +0100 Subject: [PATCH] Continued adding "--skeleton" switch. When generating DFA paths respect range lower bound as well as upper bound. --- re2c/code.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/re2c/code.cc b/re2c/code.cc index f0409e4b..49678337 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -1068,17 +1068,28 @@ static void generate_data (OutputFile & o, uint ind, State * s, const std::vecto else if (!s->generated) { s->generated = true; + uint b = 0; for (uint i = 0; i < s->go.nSpans; ++i) { std::vector, uint> > zs; for (uint j = 0; j < xs.size (); ++j) { - std::vector z (xs[j].first); - z.push_back (s->go.span[i].ub - 1); const uint l = s->rule == NULL ? xs[j].second : xs[j].first.size (); + + std::vector z (xs[j].first); + z.push_back (b); zs.push_back (std::make_pair (z, l)); + + if (b != s->go.span[i].ub - 1) + { + z.pop_back (); + z.push_back (s->go.span[i].ub - 1); + zs.push_back (std::make_pair (z, l)); + } + + b = s->go.span[i].ub; } generate_data (o, ind, s->go.span[i].to, zs, ys); } -- 2.50.1