]> granicus.if.org Git - re2c/commitdiff
- Fix -wb's binary case
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 31 Dec 2005 01:21:42 +0000 (01:21 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 31 Dec 2005 01:21:42 +0000 (01:21 +0000)
code.cc

diff --git a/code.cc b/code.cc
index 6be5b1ec959b7e162ff2b08f0c6d81f8402d0de9..03b1c443a438af8afff586b6fed001fe89ad2b55 100644 (file)
--- a/code.cc
+++ b/code.cc
@@ -639,15 +639,23 @@ void doBinary(std::ostream &o, uint ind, Span *s, uint n, const State *from, con
        else
        {
                uint h = n / 2;
-               genIf(o, ind, "<=", s[h - 1].ub - 1, readCh);
-               o << "{\n";
-               ++oline;
-               doBinary(o, ind+1, &s[0], h, from, next, readCh, mask);
-               o << indent(ind) << "} else {\n";
-               ++oline;
-               doBinary(o, ind+1, &s[h], n - h, from, next, readCh, mask);
-               o << indent(ind) << "}\n";
-               ++oline;
+
+               if (!mask || (s[h - 1].ub - 1) > 0x00FF)
+               {
+                       genIf(o, ind, "<=", s[h - 1].ub - 1, readCh);
+                       o << "{\n";
+                       ++oline;
+                       doBinary(o, ind+1, &s[0], h, from, next, readCh, mask);
+                       o << indent(ind) << "} else {\n";
+                       ++oline;
+                       doBinary(o, ind+1, &s[h], n - h, from, next, readCh, mask);
+                       o << indent(ind) << "}\n";
+                       ++oline;
+               }
+               else
+               {
+                       doBinary(o, ind, &s[h], n - h, from, next, readCh, mask);
+               }
        }
 }