[Mesa-dev] [PATCH v2] glcpp: error on multiple #else/#elif directives

Kenneth Graunke kenneth at whitecape.org
Fri Dec 20 16:01:18 PST 2013


On 12/17/2013 07:37 AM, Erik Faye-Lund wrote:
> The preprocessor currently accepts multiple else/elif-groups
> per if-section. The GLSL-preprocessor is defined by the C++
> specification, which defines the following parse-rule:
> 
> if-section:
> 	if-group elif-groups(opt) else-group(opt) endif-line
> 
> This clearly only allows a single else-group, that has to come
> after any elif-groups.
> 
> So let's modify the code to follow the specification. Add test
> to prevent regressions.
> ---
> 
> Here's a resend of an older patch (original
> <1379968503-30246-1-git-send-email-kusmabite at gmail.com>), this time
> with a better commit message, and a similar treatment for elif-after-else.

This looks good to me.  Thanks!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

Presumably Ian or Carl will commit it today...


More information about the mesa-dev mailing list