Note: in the non-EOF-rule case 're2c:yyfill:enable = 0;' results in suppression
of the whole 'YYLIMIT' check together with 'YYFILL' call. In case of EOF rule,
however, we are not bound by backward compatibility and can do a more logical
thing.
void gen_rescan_label(Output &o, const State *s)
{
const opt_t *opts = o.block().opts;
- if (opts->eof == NOEOF || endstate(s)) {
+ if (opts->eof == NOEOF || !opts->fill_use || endstate(s)) {
// no rescan label
}
else if (opts->fFlag) {
flushln(code, o);
}
else {
- o << opts->indString << "if (" << opts->fill << " () == 0) "
- << "goto " << opts->labelPrefix << retry->label << "_;";
- flushln(code, o);
+ if (opts->fill_use) {
+ o << opts->indString << "if (" << opts->fill << " () == 0) "
+ << "goto " << opts->labelPrefix << retry->label << "_;";
+ flushln(code, o);
+ }
if (from->action.type == Action::INITIAL) {
o << opts->indString << "goto " << opts->labelPrefix << "eof;";