X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.cpp;h=025af2710bb55da807fb686b6876eaef41d4ce22;hb=6dcf74922f46b086ad394c19fd6ce083a635b290;hp=85d805d1b67aeea72ee41bcec1855222732dc5ef;hpb=f526938b407e061c7424adedc34af4d1ff687f90;p=libs%2Fgl.git diff --git a/source/glsl/syntax.cpp b/source/glsl/syntax.cpp index 85d805d1..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 }, @@ -186,14 +186,12 @@ void BinaryExpression::visit(NodeVisitor &visitor) Assignment::Assignment(): - self_referencing(false), - target_declaration(0) + self_referencing(false) { } Assignment::Assignment(const Assignment &other): BinaryExpression(other), - self_referencing(other.self_referencing), - target_declaration(0) + self_referencing(other.self_referencing) { } void Assignment::visit(NodeVisitor &visitor) @@ -202,6 +200,30 @@ void Assignment::visit(NodeVisitor &visitor) } +Assignment::Target::Target(Statement *d): + declaration(d), + chain_len(0) +{ + fill(chain, chain+7, 0); +} + +bool Assignment::Target::operator<(const Target &other) const +{ + if(declaration!=other.declaration) + return declaration