From: Mikko Rasa Date: Sun, 21 Feb 2021 02:39:57 +0000 (+0200) Subject: Tweaks to the AST debug output X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=48fa4e32b654aa1f2107caf266c3bdda9cc74847 Tweaks to the AST debug output --- diff --git a/source/glsl/debug.cpp b/source/glsl/debug.cpp index 80346dd0..0a5b6ef3 100644 --- a/source/glsl/debug.cpp +++ b/source/glsl/debug.cpp @@ -147,7 +147,7 @@ void DumpTree::visit(BinaryExpression &binary) void DumpTree::visit(Assignment &assign) { - append(format("Assignment%s", (assign.self_referencing ? " (self-referencing)" : ""))); + append(format("Assignment: %s%s", assign.oper, (assign.self_referencing ? " (self-referencing)" : ""))); begin_sub(); assign.left->visit(*this); last_branch(); @@ -157,11 +157,12 @@ void DumpTree::visit(Assignment &assign) void DumpTree::visit(FunctionCall &call) { - string head = format("Function call: %s", call.name); + string head = "Function call: "; if(call.declaration) - head += format(", declaration %%%d", get_label(*call.declaration)); + head += format("%%%d ", get_label(*call.declaration)); + head += call.name; if(call.constructor) - head += ", constructor"; + head += " (constructor)"; append(head); begin_sub(); @@ -227,6 +228,8 @@ void DumpTree::visit(VariableDeclaration &var) if(!var.precision.empty()) decl += format("%s ", var.precision); decl += format("%s %s", var.type, var.name); + if(var.linked_declaration) + decl += " (linked)"; append(decl); begin_sub();