Mesa (master): glsl: Extend ast location structure to hande end token position.
Kenneth Graunke
kwg at kemper.freedesktop.org
Sat Mar 8 09:28:37 UTC 2014
Module: Mesa
Branch: master
Commit: 433d562ac6b24b5e0ff63a682316be632dfc7053
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=433d562ac6b24b5e0ff63a682316be632dfc7053
Author: Sir Anthony <anthony at adsorbtion.org>
Date: Wed Feb 5 21:18:09 2014 +0600
glsl: Extend ast location structure to hande end token position.
Reviewed-by: Carl Worth <cworth at cworth.org>
---
src/glsl/ast.h | 22 +++++++++++++---------
src/glsl/glsl_parser_extras.cpp | 6 ++++--
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 1efb306..8820993 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -75,10 +75,10 @@ public:
struct YYLTYPE locp;
locp.source = this->location.source;
- locp.first_line = this->location.line;
- locp.first_column = this->location.column;
- locp.last_line = locp.first_line;
- locp.last_column = locp.first_column;
+ locp.first_line = this->location.first_line;
+ locp.first_column = this->location.first_column;
+ locp.last_line = this->location.last_line;
+ locp.last_column = this->location.last_column;
return locp;
}
@@ -91,17 +91,21 @@ public:
void set_location(const struct YYLTYPE &locp)
{
this->location.source = locp.source;
- this->location.line = locp.first_line;
- this->location.column = locp.first_column;
+ this->location.first_line = locp.first_line;
+ this->location.first_column = locp.first_column;
+ this->location.last_line = locp.last_line;
+ this->location.last_column = locp.last_column;
}
/**
* Source location of the AST node.
*/
struct {
- unsigned source; /**< GLSL source number. */
- unsigned line; /**< Line number within the source string. */
- unsigned column; /**< Column in the line. */
+ unsigned source; /**< GLSL source number. */
+ unsigned first_line; /**< Line number within the source string. */
+ unsigned first_column; /**< Column in the line. */
+ unsigned last_line; /**< Line number within the source string. */
+ unsigned last_column; /**< Column in the line. */
} location;
exec_node link;
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index d7f5202..61ae621 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -807,8 +807,10 @@ ast_node::print(void) const
ast_node::ast_node(void)
{
this->location.source = 0;
- this->location.line = 0;
- this->location.column = 0;
+ this->location.first_line = 0;
+ this->location.first_column = 0;
+ this->location.last_line = 0;
+ this->location.last_column = 0;
}
More information about the mesa-commit
mailing list