From 48fa4e32b654aa1f2107caf266c3bdda9cc74847 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 21 Feb 2021 04:39:57 +0200 Subject: [PATCH] Tweaks to the AST debug output --- source/glsl/debug.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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(); -- 2.45.2