Current Behavior
f863c94 changed the return value of yyinput() from EOF to 0 when encountering an end-of-file:
|
case EOB_ACT_END_OF_FILE: |
|
{ |
|
if ( yywrap( M4_YY_CALL_ONLY_ARG ) ) |
|
return EOF; |
|
case EOB_ACT_END_OF_FILE: |
|
{ |
|
if ( yywrap( M4_YY_CALL_ONLY_ARG ) ) |
|
return 0; |
Inconsistence
But as documentation showed, yyinput() return EOF when encountering an end-of-file:
|
The @code{input()} routine is not redefinable, though it may be called |
|
to read characters following whatever has been matched by a rule. If |
|
@code{input()} encounters an end-of-file the normal @code{yywrap()} |
|
processing is done. A ``real'' end-of-file is returned by |
|
@code{input()} as @code{EOF}. |
And the example of comments discarding use EOF to check:
|
while ( (c = input()) != '*' && |
|
c != EOF ) |
|
if ( c == EOF ) |
|
{ |
|
error( "EOF in comment" ); |
|
break; |
|
} |
which will never break from the loop in current version.
Possible Solution
The documentation should be updated.
Current Behavior
f863c94 changed the return value of
yyinput()fromEOFto0when encountering an end-of-file:flex/src/flex.skl
Lines 1970 to 1973 in 3a4af34
flex/src/flex.skl
Lines 1970 to 1973 in f863c94
Inconsistence
But as documentation showed,
yyinput()return EOF when encountering an end-of-file:flex/doc/flex.texi
Lines 4549 to 4553 in 8b1fbf6
And the example of comments discarding use EOF to check:
flex/doc/flex.texi
Lines 1410 to 1411 in 8b1fbf6
flex/doc/flex.texi
Lines 1422 to 1426 in 8b1fbf6
which will never break from the loop in current version.
Possible Solution
The documentation should be updated.