From: Ulya Trofimovich Date: Fri, 24 Feb 2017 17:15:14 +0000 (+0000) Subject: '--dump-nfa': correctly print symbol ranges on NFA transitions. X-Git-Tag: 1.0~39^2~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa01aad3f7ed7586bfc976f60486dba978fdb9ed;p=re2c '--dump-nfa': correctly print symbol ranges on NFA transitions. --- 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;