]> granicus.if.org Git - re2c/commitdiff
Fixed atrocious typo that unconditionally enabled injective mapping.
authorUlya Trofimovich <skvadrik@gmail.com>
Thu, 8 Dec 2016 13:31:28 +0000 (13:31 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Thu, 8 Dec 2016 17:15:31 +0000 (17:15 +0000)
However, injectivity never showed up because every injective mapping
(as of now) is erroneously considered to violate tag priority.

re2c/src/ir/dfa/find_state.cc

index 101656f20cf9fed054ad38fe61fd9f4eecf036c9..466790de0660e2f28a5e7c6c293d81f0b66b2d0e 100644 (file)
@@ -145,7 +145,7 @@ bool mapping_t::operator()(const kernel_t *k1, const kernel_t *k2)
                        const tagver_t x = xv[t], y = yv[t],
                                x0 = y2x[y], y0 = x2y[x];
                        if (y0 == TAGVER_ZERO
-                               && (INJECTIVE || x0 == TAGVER_ZERO)) {
+                               && (type == INJECTIVE || x0 == TAGVER_ZERO)) {
                                x2t[x] = t;
                                x2y[x] = y;
                                y2x[y] = x;