Re: [Mesa-dev] [PATCH] glsl: Fix glcpp to catch garbage after #if 1 ... #else

2014-06-12 Thread Matt Turner
On Thu, Jun 12, 2014 at 11:26 AM, Carl Worth wrote: > Previously, a line such as: > > #else garbage > > would flag an error if it followed "#if 0", but not if it followed "#if 1". > > We fix this by setting a new bit of state (lexing_else) that allows the lexer > to defer switching to the

[Mesa-dev] [PATCH] glsl: Fix glcpp to catch garbage after #if 1 ... #else

2014-06-12 Thread Carl Worth
Previously, a line such as: #else garbage would flag an error if it followed "#if 0", but not if it followed "#if 1". We fix this by setting a new bit of state (lexing_else) that allows the lexer to defer switching to the start state until after the NEWLINE following the #else directive