[hir] Print MutableRange in lvalue

This is admittedly a little noisy but super valuable when debugging.
This commit is contained in:
Sathya Gunasekaran
2023-01-11 15:08:37 +00:00
parent bbba752e98
commit ed63dba739
+7 -4
View File
@@ -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}'`);