From ed63dba73930fb3ccc6658a497e2c09a6acb0b44 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Wed, 11 Jan 2023 15:08:37 +0000 Subject: [PATCH] [hir] Print MutableRange in lvalue This is admittedly a little noisy but super valuable when debugging. --- compiler/forget/src/HIR/PrintHIR.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/forget/src/HIR/PrintHIR.ts b/compiler/forget/src/HIR/PrintHIR.ts index edfa914b65..2e318215d0 100644 --- a/compiler/forget/src/HIR/PrintHIR.ts +++ b/compiler/forget/src/HIR/PrintHIR.ts @@ -327,16 +327,19 @@ function printMutableRange(identifier: Identifier): string { } export function printLValue(lval: LValue): string { - let place = printPlace(lval.place); + let lvalue = `${printPlace(lval.place)}${printMutableRange( + lval.place.identifier + )}`; + switch (lval.kind) { case InstructionKind.Let: { - return `Let ${place}`; + return `Let ${lvalue}`; } case InstructionKind.Const: { - return `Const ${place}`; + return `Const ${lvalue}$`; } case InstructionKind.Reassign: { - return `Reassign ${place}`; + return `Reassign ${lvalue}`; } default: { assertExhaustive(lval.kind, `Unexpected lvalue kind '${lval.kind}'`);