]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/debug.cpp
Store a pointer to operator info rather than the token in expressions
[libs/gl.git] / source / glsl / debug.cpp
index 5397372e611bd7108c3e3da0fc254e4bc9a575b4..04d7aac8ca2c442755efcc1c376f103e6fd3220d 100644 (file)
@@ -156,12 +156,13 @@ void DumpTree::visit(MemberAccess &memacc)
 
 void DumpTree::visit(UnaryExpression &unary)
 {
-       annotated_branch(format("Unary: %s, %sfix", unary.oper, (unary.prefix ? "pre" : "suff")), *unary.expression);
+       string text = format("Unary: %s, %sfix", unary.oper->token, (unary.oper->type==Operator::PREFIX ? "pre" : "post"));
+       annotated_branch(text, *unary.expression);
 }
 
 void DumpTree::visit(BinaryExpression &binary)
 {
-       append(format("Binary: %s%s", binary.oper, binary.after));
+       append(format("Binary: %s", (binary.oper->token[0]=='[' ? "[]" : binary.oper->token)));
        begin_sub();
        binary.left->visit(*this);
        last_branch();
@@ -171,7 +172,7 @@ void DumpTree::visit(BinaryExpression &binary)
 
 void DumpTree::visit(Assignment &assign)
 {
-       append(format("Assignment: %s%s", assign.oper, (assign.self_referencing ? " (self-referencing)" : "")));
+       append(format("Assignment: %s%s", assign.oper->token, (assign.self_referencing ? " (self-referencing)" : "")));
        begin_sub();
        if(assign.target_declaration)
                append(format("Target: %%%d %s %s", get_label(*assign.target_declaration), assign.target_declaration->type, assign.target_declaration->name));