diff options
author | Carl Worth <[email protected]> | 2014-06-25 13:55:18 -0700 |
---|---|---|
committer | Carl Worth <[email protected]> | 2014-07-29 15:11:50 -0700 |
commit | 18c589d20ea684f6415b28d563fd2edaae0d7b2c (patch) | |
tree | da021eee461c54e956763c1b2596da6f7e2d8b27 /src/glsl/glcpp/glcpp-lex.l | |
parent | de0b4b6607c755257a63a72d0079ef9f2aaccbc2 (diff) |
glsl/glcpp: Drop the HASH_ prefix from token names like HASH_IF
Previously, we had a single token for "#if" but now that we have two separate
tokens, it looks much better to see:
HASH_TOKEN IF
than:
HASH_TOKEN HASH_IF
(Note, that for the same reason we use HASH_TOKEN instead of HASH, we also use
DEFINE_TOKEN instead of DEFINE to avoid a conflict with the <DEFINE> start
condition in the lexer.)
There should be no behavioral change from this commit.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/glcpp-lex.l')
-rw-r--r-- | src/glsl/glcpp/glcpp-lex.l | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index 60bc0800b2d..466f4386053 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -280,7 +280,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? <HASH>version{HSPACE}+ { BEGIN INITIAL; yyextra->space_tokens = 0; - RETURN_STRING_TOKEN (HASH_VERSION); + RETURN_STRING_TOKEN (VERSION_TOKEN); } /* glcpp doesn't handle #extension, #version, or #pragma directives. @@ -289,12 +289,12 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? BEGIN INITIAL; yylineno++; yycolumn = 0; - RETURN_STRING_TOKEN (HASH_PRAGMA); + RETURN_STRING_TOKEN (PRAGMA); } <HASH>line{HSPACE}+ { BEGIN INITIAL; - RETURN_TOKEN (HASH_LINE); + RETURN_TOKEN (LINE); } <HASH>\n { @@ -308,45 +308,45 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? BEGIN INITIAL; yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - RETURN_TOKEN_NEVER_SKIP (HASH_IFDEF); + RETURN_TOKEN_NEVER_SKIP (IFDEF); } <HASH>ifndef { BEGIN INITIAL; yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - RETURN_TOKEN_NEVER_SKIP (HASH_IFNDEF); + RETURN_TOKEN_NEVER_SKIP (IFNDEF); } <HASH>if/[^_a-zA-Z0-9] { BEGIN INITIAL; yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - RETURN_TOKEN_NEVER_SKIP (HASH_IF); + RETURN_TOKEN_NEVER_SKIP (IF); } <HASH>elif/[^_a-zA-Z0-9] { BEGIN INITIAL; yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - RETURN_TOKEN_NEVER_SKIP (HASH_ELIF); + RETURN_TOKEN_NEVER_SKIP (ELIF); } <HASH>else { BEGIN INITIAL; yyextra->space_tokens = 0; - RETURN_TOKEN_NEVER_SKIP (HASH_ELSE); + RETURN_TOKEN_NEVER_SKIP (ELSE); } <HASH>endif { BEGIN INITIAL; yyextra->space_tokens = 0; - RETURN_TOKEN_NEVER_SKIP (HASH_ENDIF); + RETURN_TOKEN_NEVER_SKIP (ENDIF); } <HASH>error.* { BEGIN INITIAL; - RETURN_STRING_TOKEN (HASH_ERROR); + RETURN_STRING_TOKEN (ERROR); } /* After we see a "#define" we enter the <DEFINE> start state @@ -371,14 +371,14 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? if (! parser->skipping) { BEGIN DEFINE; yyextra->space_tokens = 0; - RETURN_TOKEN (HASH_DEFINE); + RETURN_TOKEN (DEFINE_TOKEN); } } <HASH>undef { BEGIN INITIAL; yyextra->space_tokens = 0; - RETURN_TOKEN (HASH_UNDEF); + RETURN_TOKEN (UNDEF); } <HASH>{HSPACE}+ { @@ -390,7 +390,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* This will catch any non-directive garbage after a HASH */ <HASH>{NONSPACE} { BEGIN INITIAL; - RETURN_TOKEN (HASH_GARBAGE); + RETURN_TOKEN (GARBAGE); } /* An identifier immediately followed by '(' */ |