From: helly Date: Wed, 2 Nov 2005 20:29:41 +0000 (+0000) Subject: - Fixed #1313083 -e (EBCDIC cross compile) broken. X-Git-Tag: 0.13.6~595 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e0c5f9a86d7aa4a1ba0922da56b0c324e1fa644;p=re2c - Fixed #1313083 -e (EBCDIC cross compile) broken. --- diff --git a/CHANGELOG b/CHANGELOG index 704ab11f..2edfbfb1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ Version 0.9.11 (????-??-??) --------------------------- +- Fixed #1313083 -e (EBCDIC cross compile) broken. - Fixed #1297658 underestimation of n in YYFILL(n). - Applied #1339483 Avoid rebuilds of re2c when running subtargets. - Implemented #1335305 symbol table reimplementation, just slightly modifed. diff --git a/actions.cc b/actions.cc index 28939f18..16cf2e33 100644 --- a/actions.cc +++ b/actions.cc @@ -601,7 +601,7 @@ uchar Scanner::unescape(SubStr &s) const Range * Scanner::getRange(SubStr &s) const { - uchar lb = unescape(s), ub; + uint lb = unescape(s), ub, xlb, xub, c; if (s.len < 2 || *s.str != '-') { @@ -615,11 +615,30 @@ Range * Scanner::getRange(SubStr &s) const if (ub < lb) { - uchar tmp; - tmp = lb; + uint tmp = lb; lb = ub; ub = tmp; } + + xlb = xlat[lb]; + xub = xlat[ub]; + + for(c = lb; c <= ub; c++) + { + if (!(xlb <= xlat[c] && xlat[c] <= ub)) + { + /* range doesn't work */ + Range * r = new Range(xlb, xlb + 1); + for (c = lb + 1; c <= ub; c++) + { + r = doUnion(r, new Range(xlat[c], xlat[c] + 1)); + } + return r; + } + } + + lb = xlb; + ub = xub; } return new Range(lb, ub + 1);