glsl: Add flex options to eliminate the default rule

Graphics / Mesa 3D Graphics Library / Mesa - Carl Worth [cworth.org] - 29 July 2014 17:11 UTC

We've had bugs in the past where we have been inadvertently matching the default rule.

Just as we did in the pre-processor in the previous commit, we can use:

%option warn nodefault

in the compiler to instruct flex to not generate the default rule, and further to warn if our set of rules could let any characters go unmatched.

With this warning active, flex actually warns that the catch-all rule we recently added to the compiler could never be matched. Since that is all safely determined at compile time now, we can safely drop this run-time compiler error message, (as we do in this commit).

a62354a glsl: Add flex options to eliminate the default rule
src/glsl/glsl_lexer.ll | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

Upstream: cgit.freedesktop.org


  • Share