google / graphicsfuzz

A testing framework for automatically finding and simplifying bugs in graphics shader compilers.
Apache License 2.0
562 stars 117 forks source link

Avoid if-then-else ambiguities in the grammar #1146

Closed afd closed 3 years ago

afd commented 3 years ago

This change reworks the GLSL grammar to avoid ambiguities in how if-then-else statements are handled. The approach was inspired by an Antlr grammar for Java 9. It turns out that if-then-else statements suffering from the "dangling else" problem were not being parsed as expected - the change fixes this. The hope is that by avoiding ambiguity, parsing should be more efficient.