diff options
author | marha <marha@users.sourceforge.net> | 2012-06-28 08:12:11 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-06-28 08:12:11 +0200 |
commit | 4376eeccc64a10e2a74fd0eb4184d2a144058470 (patch) | |
tree | 6a55f2d7660286e3250038228fa33d1fa1d0017e /mesalib/src/glsl/glcpp/glcpp-lex.l | |
parent | 74a24d67cefc273c717f17150b9d41607bcaf8ce (diff) | |
parent | 67551627d34fff4a0fbe719bce33a3bacb55ccef (diff) | |
download | vcxsrv-4376eeccc64a10e2a74fd0eb4184d2a144058470.tar.gz vcxsrv-4376eeccc64a10e2a74fd0eb4184d2a144058470.tar.bz2 vcxsrv-4376eeccc64a10e2a74fd0eb4184d2a144058470.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl/glcpp/glcpp-lex.l')
-rw-r--r-- | mesalib/src/glsl/glcpp/glcpp-lex.l | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/mesalib/src/glsl/glcpp/glcpp-lex.l b/mesalib/src/glsl/glcpp/glcpp-lex.l index b34f2c0e9..7ab58cb28 100644 --- a/mesalib/src/glsl/glcpp/glcpp-lex.l +++ b/mesalib/src/glsl/glcpp/glcpp-lex.l @@ -40,12 +40,18 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); #define YY_NO_INPUT -#define YY_USER_ACTION \ - do { \ - yylloc->first_column = yycolumn + 1; \ - yylloc->first_line = yylineno; \ - yycolumn += yyleng; \ - } while(0); +#define YY_USER_ACTION \ + do { \ + if (parser->has_new_line_number) \ + yylineno = parser->new_line_number; \ + if (parser->has_new_source_number) \ + yylloc->source = parser->new_source_number; \ + yylloc->first_column = yycolumn + 1; \ + yylloc->first_line = yylineno; \ + yycolumn += yyleng; \ + parser->has_new_line_number = 0; \ + parser->has_new_source_number = 0; \ + } while(0); #define YY_USER_INIT \ do { \ @@ -129,35 +135,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return OTHER; } -{HASH}line{HSPACE}+{DIGITS}{HSPACE}+{DIGITS}{HSPACE}*$ { - /* Eat characters until the first digit is - * encountered - */ - char *ptr = yytext; - while (!isdigit(*ptr)) - ptr++; - - /* Subtract one from the line number because - * yylineno is zero-based instead of - * one-based. - */ - yylineno = strtol(ptr, &ptr, 0) - 1; - yylloc->source = strtol(ptr, NULL, 0); -} - -{HASH}line{HSPACE}+{DIGITS}{HSPACE}*$ { - /* Eat characters until the first digit is - * encountered - */ - char *ptr = yytext; - while (!isdigit(*ptr)) - ptr++; - - /* Subtract one from the line number because - * yylineno is zero-based instead of - * one-based. - */ - yylineno = strtol(ptr, &ptr, 0) - 1; +{HASH}line { + return HASH_LINE; } <SKIP,INITIAL>{ |