[Mesa-dev] [PATCH] glsl/glcp: Rename all token names to have a _TOK suffix

Brian Paul brianp at vmware.com
Wed Jul 30 09:47:42 PDT 2014


On 07/30/2014 10:29 AM, Carl Worth wrote:
> Previously, we tried to have unadorned token names, (NEWLINE, SPACE, PASTE,
> etc.). But occasionally we would run into conflicts with lexer start
> conditions or with system header files that would define identical symbols,
> (such as the lexer start condition HASH or a Windows header symbol ERROR).
>
> As these various conflicts were encountered, some of the token names were
> given an _TOKEN suffix. But this was inconsistently applied, (only to those
> symbols that had caused an actual conflict).
>
> With this commit we make things consistent by applying a suffix to all token
> names. We use _TOK instead of _TOKEN to save some columns, (and to be
> consistent with the suffix used in the main glsl compiler).
>
> There is no intended behavioral change with this commit, (other than the
> slight change to some parser error messages as can be seen in the updated
> cases in the "make check" test suite for glcpp).
> ---
>   src/glsl/glcpp/glcpp-lex.l                         |  94 ++---
>   src/glsl/glcpp/glcpp-parse.y                       | 387 +++++++++++----------
>   .../glcpp/tests/102-garbage-after-endif.c.expected |   2 +-
>   .../tests/103-garbage-after-else-0.c.expected      |   2 +-
>   .../tests/123-garbage-after-else-1.c.expected      |   2 +-
>   .../tests/129-define-non-identifier.c.expected     |   2 +-
>   .../tests/136-plus-plus-and-minus-minus.c.expected |   2 +-
>   7 files changed, 246 insertions(+), 245 deletions(-)
>

I was going to test this with MSVC but the patch doesn't cleanly apply 
on master.

-Brian




More information about the mesa-dev mailing list