From: helly Date: Sat, 15 Apr 2006 18:44:20 +0000 (+0000) Subject: - Fixed -i switch. X-Git-Tag: 0.13.6~392 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37f7c8a7846b49c22518f035e34fccf19628fa99;p=re2c - Fixed -i switch. - Added configuration 'yyfill:enable' to allow suppression of YYFILL() blocks. --- diff --git a/CHANGELOG b/CHANGELOG index a01a7355..6852abfa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ -Version 0.10.2 (2006-04-13) +Version 0.10.2 (2006-??-??) --------------------------- +- Fixed -i switch. +- Added configuration 'yyfill:enable' to allow suppression of YYFILL() blocks. - Added tutorial like lessons to re2c. - Added /*!ignore!re2c */ to support documenting of re2c source. - Fixed issue with multiline re2c comments (/*!max:re2c ... */ and alike). diff --git a/code.cc b/code.cc index 382c3897..ec826ac8 100644 --- a/code.cc +++ b/code.cc @@ -301,13 +301,16 @@ static void need(std::ostream &o, uint ind, uint n, bool & readCh, bool bSetMark o << indent(ind) << "YYSETSTATE(" << fillIndex << ");\n"; } - if (n == 1) + if (bUseYYFill) { - o << indent(ind) << "if(YYLIMIT == YYCURSOR) YYFILL(1);\n"; - } - else - { - o << indent(ind) << "if((YYLIMIT - YYCURSOR) < " << n << ") YYFILL(" << n << ");\n"; + if (n == 1) + { + o << indent(ind) << "if(YYLIMIT == YYCURSOR) YYFILL(1);\n"; + } + else + { + o << indent(ind) << "if((YYLIMIT - YYCURSOR) < " << n << ") YYFILL(" << n << ");\n"; + } } if (fFlag) @@ -1461,7 +1464,7 @@ void genGetState(std::ostream &o, uint& ind, uint start_label) std::ostream& operator << (std::ostream& o, const file_info& li) { - if (li.ln) + if (li.ln && !iFlag) { o << "#line " << li.ln->get_line() << " \"" << li.fname << "\"\n"; } @@ -1500,6 +1503,10 @@ void Scanner::config(const Str& cfg, int num) { bUseStateNext = num != 0; } + else if (cfg.to_string() == "yyfill:enable") + { + bUseYYFill = num != 0; + } else { fatal("unrecognized configuration name or illegal integer value"); diff --git a/globals.h b/globals.h index 59103965..7ca83829 100644 --- a/globals.h +++ b/globals.h @@ -35,6 +35,7 @@ extern bool yybmHexTable; extern bool bUseStateAbort; extern bool bUseStateNext; extern bool bWroteGetState; +extern bool bUseYYFill; extern uint asc2ebc[256]; extern uint ebc2asc[256]; diff --git a/htdocs/index.html b/htdocs/index.html index cb638897..ca954398 100755 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -76,8 +76,10 @@ provide re2c packages.

Changelog

-

2006-04-13: 0.10.2

+

2006-??-??: 0.10.2