Thanks to Nazim Can Bedir for the bug report.
}
flushln(code, o);
- o << opts->indString << opts->fill << "();";
+ o << opts->indString << opts->fill
+ << (opts->fill_naked ? "" : opts->fill_arg_use ? "();" : ";");
flushln(code, o);
o << opts->indString << opts->labelPrefix << "eof" << fillidx << ":;";
}
else {
if (opts->fill_use) {
- o << opts->indString << "if (" << opts->fill << " () == 0) "
- << "goto " << opts->labelPrefix << retry->label << "_;";
+ o << opts->indString << "if (" << opts->fill
+ << (opts->fill_naked ? ""
+ : opts->fill_arg_use ? " () == 0" : " == 0")
+ << ") goto " << opts->labelPrefix << retry->label << "_;";
flushln(code, o);
}
gen_on_eof_fail(code, opts, dfa, from, to, o);
--- /dev/null
+/* Generated by re2c */
+
+
+
+{
+ YYCTYPE yych;
+yy1_:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy4;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ if (fill() == 0) goto yy1_;
+ goto yyeof;
+ }
+ goto yy2;
+ }
+yy2:
+ ++YYCURSOR;
+yy3:
+ { return FAIL; }
+yy4:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+}
+
+
+
+{
+ YYCTYPE yych;
+yy7_:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy10;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ if (fill() == 0) goto yy7_;
+ goto yyeof;
+ }
+ goto yy8;
+ }
+yy8:
+ ++YYCURSOR;
+yy9:
+ { return FAIL; }
+yy10:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+}
+
+
+
+{
+ YYCTYPE yych;
+yy13_:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy16;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ if (fill () == 0) goto yy13_;
+ goto yyeof;
+ }
+ goto yy14;
+ }
+yy14:
+ ++YYCURSOR;
+yy15:
+ { return FAIL; }
+yy16:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+}
+
+
+
+{
+ YYCTYPE yych;
+yy19_:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy22;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ if (fill() == 0) goto yy19_;
+ goto yyeof;
+ }
+ goto yy20;
+ }
+yy20:
+ ++YYCURSOR;
+yy21:
+ { return FAIL; }
+yy22:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+}
+
--- /dev/null
+/*!re2c
+ re2c:eof = 0;
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill() == 0";
+ re2c:define:YYFILL:naked = 1;
+ re2c:yyfill:parameter = 1;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill() == 0";
+ re2c:define:YYFILL:naked = 1;
+ re2c:yyfill:parameter = 0;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill";
+ re2c:define:YYFILL:naked = 0;
+ re2c:yyfill:parameter = 1;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill()";
+ re2c:define:YYFILL:naked = 0;
+ re2c:yyfill:parameter = 0;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
--- /dev/null
+/* Generated by re2c */
+
+
+
+
+ switch (YYGETSTATE()) {
+ default: goto yy0;
+ case 0: if (YYLIMIT <= YYCURSOR) goto yyeof0; goto yyFillLabel0;
+ case 1: if (YYLIMIT <= YYCURSOR) goto yyeof1; goto yyFillLabel1;
+ case 2: if (YYLIMIT <= YYCURSOR) goto yyeof2; goto yyFillLabel2;
+ case 3: if (YYLIMIT <= YYCURSOR) goto yyeof3; goto yyFillLabel3;
+ }
+yy0:
+yyFillLabel0:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy4;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ YYSETSTATE(0);
+ fill();
+ yyeof0:;
+ goto yyeof;
+ }
+ goto yy2;
+ }
+yy2:
+ ++YYCURSOR;
+yy3:
+ { return FAIL; }
+yy4:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+
+
+
+
+yyFillLabel1:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy10;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ YYSETSTATE(1);
+ fill();
+ yyeof1:;
+ goto yyeof;
+ }
+ goto yy8;
+ }
+yy8:
+ ++YYCURSOR;
+yy9:
+ { return FAIL; }
+yy10:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+
+
+
+
+yyFillLabel2:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy16;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ YYSETSTATE(2);
+ fill();
+ yyeof2:;
+ goto yyeof;
+ }
+ goto yy14;
+ }
+yy14:
+ ++YYCURSOR;
+yy15:
+ { return FAIL; }
+yy16:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+
+
+
+
+yyFillLabel3:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy22;
+ default:
+ if (YYLIMIT <= YYCURSOR) {
+ YYSETSTATE(3);
+ fill();
+ yyeof3:;
+ goto yyeof;
+ }
+ goto yy20;
+ }
+yy20:
+ ++YYCURSOR;
+yy21:
+ { return FAIL; }
+yy22:
+ ++YYCURSOR;
+ { return OK; }
+yyeof:
+ { return EOF; }
+
--- /dev/null
+/*!re2c
+ re2c:eof = 0;
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill();";
+ re2c:define:YYFILL:naked = 1;
+ re2c:yyfill:parameter = 1;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill();";
+ re2c:define:YYFILL:naked = 1;
+ re2c:yyfill:parameter = 0;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill";
+ re2c:define:YYFILL:naked = 0;
+ re2c:yyfill:parameter = 1;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
+
+/*!re2c
+ re2c:define:YYFILL = "fill()";
+ re2c:define:YYFILL:naked = 0;
+ re2c:yyfill:parameter = 0;
+ * { return FAIL; }
+ $ { return EOF; }
+ [a] { return OK; }
+*/
uint8_t *YYMARKER, *tok = cur;
/*!re2c
re2c:yyfill:enable = 1;
+ re2c:define:YYFILL:naked = 0;
re2c:define:YYFILL = fill;
re2c:eof = 0;