glsl: Add ast_node method to set location range.

Reviewed-by: Carl Worth <cworth@cworth.org>
This commit is contained in:
Sir Anthony 2014-02-05 21:18:10 +06:00 committed by Kenneth Graunke
parent 654ee41cd3
commit 5656775cf6
1 changed files with 14 additions and 0 deletions

View File

@ -97,6 +97,20 @@ public:
this->location.last_column = locp.last_column;
}
/**
* Set the source location range of an AST node using two location nodes
*
* \sa ast_node::set_location
*/
void set_location_range(const struct YYLTYPE &begin, const struct YYLTYPE &end)
{
this->location.source = begin.source;
this->location.first_line = begin.first_line;
this->location.last_line = end.last_line;
this->location.first_column = begin.first_column;
this->location.last_column = end.last_column;
}
/**
* Source location of the AST node.
*/