From: helly Date: Sat, 31 Dec 2005 01:21:42 +0000 (+0000) Subject: - Fix -wb's binary case X-Git-Tag: 0.13.6~529 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdfc7939dca57cb7a8683c0a6989f85c91de433b;p=re2c - Fix -wb's binary case --- diff --git a/code.cc b/code.cc index 6be5b1ec..03b1c443 100644 --- 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); + } } }