]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Record location information in all syntax nodes
[libs/gl.git] / source / glsl / syntax.h
index da7b0907e37460d5b7041d32e2c921dee9473563..f275eab8c4ae454ee369ac10e40d3c0e4499190a 100644 (file)
@@ -55,9 +55,11 @@ struct NodeVisitor;
 
 struct Node
 {
-protected:
-       Node() { }
-       Node(const Node &) { }
+       int source;
+       unsigned line;
+
+       Node(): source(GENERATED_SOURCE), line(1) { }
+       Node(const Node &n): source(n.source), line(n.line) { }
 private:
        Node &operator=(const Node &);
 public:
@@ -106,11 +108,6 @@ struct FunctionDeclaration;
 
 struct Statement: Node
 {
-       int source;
-       unsigned line;
-
-       Statement();
-
        virtual Statement *clone() const = 0;
 };