bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scan-gram.l: for flex-2.5.31: move unput call into body


From: Akim Demaille
Subject: Re: [PATCH] scan-gram.l: for flex-2.5.31: move unput call into body
Date: Fri, 25 Apr 2003 19:18:00 +0200
User-agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3 (gnu/linux)

| Peter Muir <address@hidden> writes:
| > the debian maintainer for flex says the behaviour of flex is correct
| > (and suggested to move the function inside %{...%}).
| 
| That doesn't work, for reasons discussed in my email of a few minutes ago.
| Thanks for the bug report, though.  I installed the following patch.
| 
| 2003-04-17  Paul Eggert  <address@hidden>
| 
|       * src/scan-gram.l: Add %option nounput, since we no longer use unput.
|       (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
|       Do not insert the expected token via unput, as this runs afoul
|       of a POSIX-compatibility bug in flex 2.5.31.
|       All uses changed to BEGIN the parent state,
|       since we no longer insert the expected token via unput.
|       * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
|       that is no longer emitted after the above change.
| 
| @@ -368,7 +368,7 @@ splice     (\\[ \f\t\v]*\n)*
|    }
|  
|    .|\n           STRING_GROW;
| -  <<EOF>>   unexpected_end_of_file (token_start, "\"");
| +  <<EOF>>   unexpected_eof (token_start, "\""); BEGIN INITIAL;
|  }

Hi Paul,

Why don't you return the string here?  That's what I'm used to do, and
it is effective.  Actually, I never quite understood why you use unput
to insert the missing ending, instead of merely reseting the start
condition, emit an error, and then return the token anyway.  This way,
this part of the patch:

|       * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
|       that is no longer emitted after the above change.

can be reverted.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]