glsl: Add ast_node method to set location range.
authorSir Anthony <anthony@adsorbtion.org>
Wed, 5 Feb 2014 15:18:10 +0000 (21:18 +0600)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Mar 2014 09:29:00 +0000 (01:29 -0800)
Reviewed-by: Carl Worth <cworth@cworth.org>
src/glsl/ast.h

index 13e8408f96fb8c8ae862b7aacdc2756b6ccb59df..ae70b003cfeba94cf5a587f3556a61255fa2e319 100644 (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.
     */