From 5d2fae8c36b6f3b1fd384dbc518575cf21d65209 Mon Sep 17 00:00:00 2001 From: helly Date: Sat, 24 Feb 2007 17:21:01 +0000 Subject: [PATCH] - Fix minor issue with -u code generation --- re2c/CHANGELOG | 1 + re2c/code.cc | 4 ++-- re2c/test/cvsignore.wb.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/re2c/CHANGELOG b/re2c/CHANGELOG index 0519ccd8..3ea6cfea 100644 --- a/re2c/CHANGELOG +++ b/re2c/CHANGELOG @@ -1,5 +1,6 @@ Version 0.11.2 (????-??-??) --------------------------- +- Fixed -u switch code generation. - Added ability to avoid defines and overwrite variable and label names. Version 0.11.1 (2007-02-20) diff --git a/re2c/code.cc b/re2c/code.cc index 17851bb7..1d3af097 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -904,7 +904,7 @@ void Go::genCpGoto(std::ostream &o, uint ind, const State *from, const State *ne readCh = false; if (wFlag) { - o << indent(ind) << "if(" << sYych <<" & 0xFF00) {\n"; + o << indent(ind) << "if(" << sYych <<" & ~0xFF) {\n"; genBase(o, ind+1, from, next, readCh, 1); o << indent(ind++) << "} else {\n"; sYych = mapCodeName["yych"]; @@ -1021,7 +1021,7 @@ void Go::genGoto(std::ostream &o, uint ind, const State *from, const State *next readCh = false; if (wFlag) { - o << indent(ind) << "if(" << sYych << " & 0xFF00) {\n"; + o << indent(ind) << "if(" << sYych << " & ~0xFF) {\n"; sYych = mapCodeName["yych"]; genBase(o, ind+1, from, next, readCh, 1); o << indent(ind) << "} else "; diff --git a/re2c/test/cvsignore.wb.c b/re2c/test/cvsignore.wb.c index d51ee1c6..04a0bfd4 100755 --- a/re2c/test/cvsignore.wb.c +++ b/re2c/test/cvsignore.wb.c @@ -138,7 +138,7 @@ yy17: if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy18: - if(yych & 0xFF00) { + if(yych & ~0xFF) { goto yy17; } else if(yybm[0+yych] & 128) { goto yy17; -- 2.50.1