]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.cpp
Add GLSL keywords for overriding functions
[libs/gl.git] / source / glsl / syntax.cpp
index 71e5c39a948aabc7db12e701a80bcca32cfef3dc..025af2710bb55da807fb686b6876eaef41d4ce22 100644 (file)
@@ -40,8 +40,8 @@ const Operator Operator::operators[] =
        { "&&", 12, BINARY, ASSOCIATIVE },
        { "^^", 13, BINARY, ASSOCIATIVE },
        { "||", 14, BINARY, ASSOCIATIVE },
-       { "?", 15, BINARY, RIGHT_TO_LEFT },
-       { ":", 15, BINARY, RIGHT_TO_LEFT },
+       { "?", 15, TERNARY, RIGHT_TO_LEFT },
+       { ":", 15, TERNARY, RIGHT_TO_LEFT },
        { "=", 16, BINARY, RIGHT_TO_LEFT },
        { "+=", 16, BINARY, RIGHT_TO_LEFT },
        { "-=", 16, BINARY, RIGHT_TO_LEFT },
@@ -218,6 +218,12 @@ bool Assignment::Target::operator<(const Target &other) const
 }
 
 
+void TernaryExpression::visit(NodeVisitor &visitor)
+{
+       visitor.visit(*this);
+}
+
+
 FunctionCall::FunctionCall():
        constructor(false),
        declaration(0)
@@ -394,6 +400,8 @@ void InterfaceBlock::visit(NodeVisitor &visitor)
 
 
 FunctionDeclaration::FunctionDeclaration():
+       virtua(false),
+       overrd(false),
        definition(0),
        return_type_declaration(0)
 { }
@@ -403,7 +411,10 @@ FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other):
        return_type(other.return_type),
        name(other.name),
        parameters(other.parameters),
+       virtua(other.virtua),
+       overrd(other.overrd),
        body(other.body),
+       signature(other.signature),
        definition(other.definition==&other ? this : 0),
        return_type_declaration(0)
 { }