[Mesa-dev] [RFC PATCH] automake: add support to src/glsl/
Ian Romanick
idr at freedesktop.org
Tue Sep 27 09:40:33 PDT 2011
On 09/26/2011 03:05 PM, Eric Anholt wrote:
> On Mon, 26 Sep 2011 11:38:10 -0400, Matt Turner<mattst88 at gmail.com> wrote:
>> On Mon, Sep 26, 2011 at 11:29 AM, Eric Anholt<eric at anholt.net> wrote:
>>> On Sun, 25 Sep 2011 15:36:02 -0400, Matt Turner<mattst88 at gmail.com> wrote:
>>>> diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
>>>> index cfd8926..dd7c68c 100644
>>>> --- a/src/glsl/glsl_lexer.ll
>>>> +++ b/src/glsl/glsl_lexer.ll
>>>> @@ -104,8 +104,8 @@ HASH ^{SPC}#{SPC}
>>>>
>>>> /* Preprocessor tokens. */
>>>> ^[ \t]*#[ \t]*$ ;
>>>> -^[ \t]*#[ \t]*version { BEGIN PP; return VERSION; }
>>>> -^[ \t]*#[ \t]*extension { BEGIN PP; return EXTENSION; }
>>>> +^[ \t]*#[ \t]*version { BEGIN PP; return GLSL_VERS; }
>>>> +^[ \t]*#[ \t]*extension { BEGIN PP; return GLSL_EXTENSION; }
>>>> {HASH}line{SPCP}{INT}{SPCP}{INT}{SPC}$ {
>>>> /* Eat characters until the first digit is
>>>> * encountered
>>>> diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
>>>> index 25d02fb..831f72a 100644
>>>> --- a/src/glsl/glsl_parser.yy
>>>> +++ b/src/glsl/glsl_parser.yy
>>>> @@ -106,7 +106,7 @@
>>>> %token INVARIANT
>>>> %token LOWP MEDIUMP HIGHP SUPERP PRECISION
>>>>
>>>> -%token VERSION EXTENSION LINE COLON EOL INTERFACE OUTPUT
>>>> +%token GLSL_VERS GLSL_EXTENSION LINE COLON EOL INTERFACE OUTPUT
>>>> %token PRAGMA_DEBUG_ON PRAGMA_DEBUG_OFF
>>>> %token PRAGMA_OPTIMIZE_ON PRAGMA_OPTIMIZE_OFF
>>>> %token PRAGMA_INVARIANT_ALL
>>>> @@ -228,7 +228,7 @@ translation_unit:
>>>>
>>>> version_statement:
>>>> /* blank - no #version specified: defaults are already set */
>>>> - | VERSION INTCONSTANT EOL
>>>> + | GLSL_VERS INTCONSTANT EOL
>>>> {
>>>> bool supported = false;
>>>>
>>>> @@ -296,7 +296,7 @@ any_identifier:
>>>> ;
>>>>
>>>> extension_statement:
>>>> - EXTENSION any_identifier COLON any_identifier EOL
>>>> + GLSL_EXTENSION any_identifier COLON any_identifier EOL
>>>> {
>>>> if (!_mesa_glsl_process_extension($2,& @2, $4,& @4, state)) {
>>>> YYERROR;
>>>> --
>>>> 1.7.3.4
>>>>
>>>
>>> I'd prefer VERSION to be fully spelled out, and it's probably worth
>>> being in a separate commit.
>>
>> Yeah, will do. I feel like there's a better way to deal with this anyway.
>
> For the other tokens with conflicts, we appended _TOK. (INLINE_TOK,
> PUBLIC_TOK), so probably just use that convention.
I was just going to say the same thing. EXTENSION_TOK and VERSION_TOK
are much preferred names.
More information about the mesa-dev
mailing list