X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fglsl%2Foutput.cpp;h=35c52fec51fc109ada7ad10f7e73b48836955cd2;hb=911c6c4acc8218bc40d93917207f9dc32e9f2596;hp=718b1a8bcde406ec124f7959f314b606361c1d2a;hpb=3e24a1bfd5a259b185ff0f37046dd0489e1908a3;p=libs%2Fgl.git diff --git a/source/glsl/output.cpp b/source/glsl/output.cpp index 718b1a8b..35c52fec 100644 --- a/source/glsl/output.cpp +++ b/source/glsl/output.cpp @@ -156,8 +156,8 @@ void Formatter::visit(BinaryExpression &binary) binary.left->visit(*this); append(binary.oper->token); binary.right->visit(*this); - if(binary.oper->token[0]=='[') - append(']'); + if(binary.oper->token2[0]) + append(binary.oper->token2); } void Formatter::visit(Assignment &assign) @@ -167,6 +167,16 @@ void Formatter::visit(Assignment &assign) assign.right->visit(*this); } +void Formatter::visit(TernaryExpression &ternary) +{ + ternary.condition->visit(*this); + append(ternary.oper->token); + ternary.true_expr->visit(*this); + if(ternary.oper->token2) + append(ternary.oper->token2); + ternary.false_expr->visit(*this); +} + void Formatter::visit(FunctionCall &call) { append(format("%s(", call.name));