diff options
author | marha <marha@users.sourceforge.net> | 2014-07-11 18:00:29 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-07-11 18:00:29 +0200 |
commit | e708bebcc029873004ade4241f347ce8c58896af (patch) | |
tree | 0b942757c1846afbe11e4158438981d6a645849d /mesalib/src/glsl/glcpp/glcpp-lex.l | |
parent | fe03d6aef6338e43593f164b09ae993bcd0ecbdd (diff) | |
download | vcxsrv-e708bebcc029873004ade4241f347ce8c58896af.tar.gz vcxsrv-e708bebcc029873004ade4241f347ce8c58896af.tar.bz2 vcxsrv-e708bebcc029873004ade4241f347ce8c58896af.zip |
fontconfig libX11 xserver mkfontscale mesa git update 11 July 2014
xserver commit 9de3cc8daa4c6e877d30a0e8ccfe0cc159f1dbe3
libX11 commit ff9a5c199251a84fa59d14fd48dadb3f8920b54b
mkfontscale commit 47908fd7a0d061fdcd21e3498da4e223ca9136d9
fontconfig commit dca5d0feee5eb6428bec48b1aff4396cf92c76c0
mesa commit f381c27c548aa28b003c8e188f5d627ab4105f76
Diffstat (limited to 'mesalib/src/glsl/glcpp/glcpp-lex.l')
-rw-r--r-- | mesalib/src/glsl/glcpp/glcpp-lex.l | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/mesalib/src/glsl/glcpp/glcpp-lex.l b/mesalib/src/glsl/glcpp/glcpp-lex.l index 188e45466..a1a8e76af 100644 --- a/mesalib/src/glsl/glcpp/glcpp-lex.l +++ b/mesalib/src/glsl/glcpp/glcpp-lex.l @@ -76,6 +76,7 @@ NEWLINE [\n] HSPACE [ \t] HASH ^{HSPACE}*#{HSPACE}* IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]* +PP_NUMBER [.]?[0-9]([._a-zA-Z0-9]|[eEpP][-+])* PUNCTUATION [][(){}.&*~!/%<>^|;,=+-] /* The OTHER class is simply a catch-all for things that the CPP @@ -137,14 +138,15 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? * 2. The skip_stack is NULL meaning that we've reached * the last #endif. * - * 3. The lexing_if bit is set. This indicates that we - * are lexing the expression following an "#if" of - * "#elif". Even inside an "#if 0" we need to lex this - * expression so the parser can correctly update the - * skip_stack state. + * 3. The lexing_directive bit is set. This indicates that we are + * lexing a pre-processor directive, (such as #if, #elif, or + * #else). For the #if and #elif directives we always need to + * parse the conditions, (even if otherwise within an #if + * 0). And for #else, we want to be able to generate an error + * if any garbage follows #else. */ if (YY_START == INITIAL || YY_START == SKIP) { - if (parser->lexing_if || + if (parser->lexing_directive || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { @@ -178,7 +180,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ -{HASH}(extension|pragma)[^\n]+ { +{HASH}(extension|pragma)[^\n]* { if (parser->commented_newlines) BEGIN NEWLINE_CATCHUP; yylval->str = ralloc_strdup (yyextra, yytext); @@ -193,25 +195,25 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? <SKIP,INITIAL>{ {HASH}ifdef { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_IFDEF; } {HASH}ifndef { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_IFNDEF; } {HASH}if/[^_a-zA-Z0-9] { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_IF; } {HASH}elif/[^_a-zA-Z0-9] { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_ELIF; } @@ -329,6 +331,11 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return IDENTIFIER; } +{PP_NUMBER} { + yylval->str = ralloc_strdup (yyextra, yytext); + return OTHER; +} + {PUNCTUATION} { return yytext[0]; } @@ -348,7 +355,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? if (parser->commented_newlines) { BEGIN NEWLINE_CATCHUP; } - yyextra->lexing_if = 0; + yyextra->lexing_directive = 0; yylineno++; yycolumn = 0; return NEWLINE; @@ -357,7 +364,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* Handle missing newline at EOF. */ <INITIAL><<EOF>> { BEGIN DONE; /* Don't keep matching this rule forever. */ - yyextra->lexing_if = 0; + yyextra->lexing_directive = 0; return NEWLINE; } |