This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cpplib: expression parser


On Fri, Mar 31, 2000 at 08:29:27PM +0900, Neil Booth wrote:
> This is the first of a set of patches to the preprocessor's expression
> parser.  The ultimate goal is to make the code a little clearer and
> faster, and to improve the quality of the error messages.
> 
> This patch fixes the following bugs:-
> 
> o "#if" by itself without an expression was accepted.
> 
> o "#if (2" produced an internal compiler error.
> 
> o "#if  1 ? 1 ? 2 : 2 : 1" produced a "':' without '?'" error.
> 
> o "#if 1 + + + 1" was accepted.
> 
> o Now I understand the algorithm better, the correct fix to the bug
>   Jonathan reported a couple of weeks ago:
> 	#if 16 * (1) + 4 == 20
>   now evaluates to true rather than false, because the '+' is
>   correctly interpreted as a binary operator.
> 
> A bit later I'll add a series of test suites for cpplib's expression
> parser based on those I'm using for testing, which should exercise
> most operator-combination possibilities.

OK.

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]