From 949596c1e7f6dbdbd841c7e752cc5651d06b21b4 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Wed, 25 May 2016 10:52:20 +0100 Subject: [PATCH] Traverse NFA from left to right when building epsilon-closure. --- re2c/src/ir/dfa/determinization.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re2c/src/ir/dfa/determinization.cc b/re2c/src/ir/dfa/determinization.cc index 7b748166..6a9666eb 100644 --- a/re2c/src/ir/dfa/determinization.cc +++ b/re2c/src/ir/dfa/determinization.cc @@ -75,8 +75,8 @@ static void closure(kitem_t *const kernel, kitem_t *&kend, ++n->loop; switch (n->type) { case nfa_state_t::ALT: - closure(kernel, kend, n->alt.out2, tags, badtags, ntags); closure(kernel, kend, n->alt.out1, tags, badtags, ntags); + closure(kernel, kend, n->alt.out2, tags, badtags, ntags); break; case nfa_state_t::TAG: { const size_t t = n->tag.info; -- 2.40.0