On Tue, Jun 09 2015, Ian Romanick wrote:
>> From section 3.4 ("Preprocessor") of the GLSL ES 3.00 specification:
>> "#line must have, after macro substitution, one of the following forms:
>>      #line line
>>      #line line source-string-number
>> where line and source-string-number are constant integral
>> expressions."
...
>> From section 4.3.3 ("Constant Expressions") of the same specification:
>> "A constant integral expression is a constant expression that evaluates
>> to a scalar signed or unsigned integer."

Yes. That's an extremely unfortunate piece of the specification.

This, together with unary operators introduces inherent ambiguity into
the grammar. Just think about things like:

#line 2-1+5
#line 2 -1+5
#line 2-1 +5

#line 2-1+5 3
#line 2 -1+5 3
#line 2-1 +5 3

That's off the top of my head. I'll dig through some old branches to see
if I have some other gems for testing this stuff.

> FFS.  I can't believe they have a test for this.  For what it's worth,
> this makes the grammar non-LALR.  Not too long ago it came up for a vote
> to remove this since it does not work on *ANY* desktop OpenGL
> implementation.  While there was a majority vote to remove it, it was
> not a large enough majority (by a single vote).  It is also a deviation
> from C / C++ preprocessors.
>
> Carl spent some time on this, and he couldn't find a way to make it work
> without adding significant bison warnings or have it fail for some
> cases.

I would definitely push back against anyone enforcing this piece of the
specification in a test suite. It's language that really doesn't belong
in the specification.

But I'll also take a look at this patch. Thanks for bringing it to my
attention, Ian.

-Carl

Attachment: pgpo0L7QdI8dN.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to