X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=025af2710bb55da807fb686b6876eaef41d4ce22;hb=6dcf74922f46b086ad394c19fd6ce083a635b290;hp=71e5c39a948aabc7db12e701a80bcca32cfef3dc;hpb=cc3f4aaaf8d2b34347f69b026c10f82797059aa4;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 71e5c39a..025af271 100644 --- a/source/glsl/syntax.cpp +++ b/source/glsl/syntax.cpp @@ -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) { }