-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't fail when zero condition
<>
has no end-of-inpt rule $
.
Previously re2c failed with an error in the case when end-of-input rule `$` was enabled and the special zero condition `<>` was used. Now it no longer fails and generates code withot end-of-input check for the zero condition (which is handled in a special way by the code, bypassing some of the transformations that rely on the presence of end-of-input rule).
- Loading branch information
Showing
4 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
re2c: error: in condition '0' `re2c:eof` configuration is set, but no $ rule found | ||
/* Generated by re2c */ | ||
// re2c $INPUT -o $OUTPUT -ci | ||
|
||
{ | ||
YYCTYPE yych; | ||
switch (YYGETCONDITION()) { | ||
case yyc0: goto yyc_0; | ||
case yycx: goto yyc_x; | ||
case yycy: goto yyc_y; | ||
} | ||
/* *********************************** */ | ||
yyc_0: | ||
{ return NULL; } | ||
/* *********************************** */ | ||
yyc_x: | ||
yyFillLabel0: | ||
yych = *YYCURSOR; | ||
switch (yych) { | ||
case 'a': goto yy3; | ||
default: | ||
if (YYLIMIT <= YYCURSOR) { | ||
if (YYFILL() == 0) goto yyFillLabel0; | ||
goto yy4; | ||
} | ||
goto yy2; | ||
} | ||
yy2: | ||
++YYCURSOR; | ||
{ return "*"; } | ||
yy3: | ||
++YYCURSOR; | ||
{ return "a"; } | ||
yy4: | ||
{ return "$"; } | ||
/* *********************************** */ | ||
yyc_y: | ||
yyFillLabel1: | ||
yych = *YYCURSOR; | ||
switch (yych) { | ||
case 'a': goto yy7; | ||
default: | ||
if (YYLIMIT <= YYCURSOR) { | ||
if (YYFILL() == 0) goto yyFillLabel1; | ||
goto yy8; | ||
} | ||
goto yy6; | ||
} | ||
yy6: | ||
++YYCURSOR; | ||
{ return "*"; } | ||
yy7: | ||
++YYCURSOR; | ||
{ return "a"; } | ||
yy8: | ||
{ return "$y"; } | ||
} | ||
|