Mesa (master): glsl: Update lexers in glsl and glcpp to hande end position of token.

Kenneth Graunke kwg at kemper.freedesktop.org
Sat Mar 8 09:28:37 UTC 2014


Module: Mesa
Branch: master
Commit: 6984aa43504bd9b68692872cd711af3931607576
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6984aa43504bd9b68692872cd711af3931607576

Author: Sir Anthony <anthony at adsorbtion.org>
Date:   Wed Feb  5 21:18:08 2014 +0600

glsl: Update lexers in glsl and glcpp to hande end position of token.

Reviewed-by: Carl Worth <cworth at cworth.org>

---

 src/glsl/glcpp/glcpp-lex.l |    3 ++-
 src/glsl/glsl_lexer.ll     |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index ea3b862..6bf7950 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -47,8 +47,9 @@ void glcpp_set_column (int  column_no , yyscan_t yyscanner);
 		if (parser->has_new_source_number)			\
 			yylloc->source = parser->new_source_number;	\
 		yylloc->first_column = yycolumn + 1;			\
-		yylloc->first_line = yylineno;				\
+		yylloc->first_line = yylloc->last_line = yylineno;	\
 		yycolumn += yyleng;					\
+		yylloc->last_column = yycolumn + 1;			\
 		parser->has_new_line_number = 0;			\
 		parser->has_new_source_number = 0;			\
  } while(0);
diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
index 9fd9b80..7602351 100644
--- a/src/glsl/glsl_lexer.ll
+++ b/src/glsl/glsl_lexer.ll
@@ -38,8 +38,9 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
    do {								\
       yylloc->source = 0;					\
       yylloc->first_column = yycolumn + 1;			\
-      yylloc->first_line = yylineno + 1;			\
+      yylloc->first_line = yylloc->last_line = yylineno + 1;	\
       yycolumn += yyleng;					\
+      yylloc->last_column = yycolumn + 1;			\
    } while(0);
 
 #define YY_USER_INIT yylineno = 0; yycolumn = 0;




More information about the mesa-commit mailing list