From fa01aad3f7ed7586bfc976f60486dba978fdb9ed Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Fri, 24 Feb 2017 17:15:14 +0000 Subject: [PATCH] '--dump-nfa': correctly print symbol ranges on NFA transitions. --- re2c/src/ir/nfa/dump.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/re2c/src/ir/nfa/dump.cc b/re2c/src/ir/nfa/dump.cc index 6645afd4..c0b32ee8 100644 --- a/re2c/src/ir/nfa/dump.cc +++ b/re2c/src/ir/nfa/dump.cc @@ -33,12 +33,14 @@ void dump_nfa(const nfa_t &nfa) fprintf(stderr, " n%u -> n%u [color=lightgray]\n", i, index(nfa, n->alt.out2)); break; case nfa_state_t::RAN: { - const uint32_t - l = n->ran.ran->lower(), - u = n->ran.ran->upper() - 1; - fprintf(stderr, " n%u -> n%u [label=\"%u", i, index(nfa, n->ran.out), l); - if (u > l) { - fprintf(stderr, "-%u", u); + fprintf(stderr, " n%u -> n%u [label=\"", i, index(nfa, n->ran.out)); + for (const Range *r = n->ran.ran; r; r = r->next()) { + const uint32_t + l = r->lower(), + u = r->upper() - 1; + fprintf(stderr, "%u", l); + if (u > l) fprintf(stderr, "-%u", u); + if (r->next()) fprintf(stderr, ","); } fprintf(stderr, "\"]\n"); break; -- 2.40.0