Make InterpreterObject default to printing actual values

This commit is contained in:
Yoshi Askharoun
2023-10-11 13:23:18 -05:00
parent 63fd7848c1
commit 06f47d21ca
@@ -57,7 +57,7 @@ public class InterpreterObject
return sb.ToString(); return sb.ToString();
} }
public void ToString(StringBuilder sb, bool includeType = false) public void ToString(StringBuilder sb, bool includeType = false, bool includeSource = false)
{ {
if (includeType) if (includeType)
{ {
@@ -65,16 +65,23 @@ public class InterpreterObject
sb.Append(' '); sb.Append(' ');
} }
if (Source == InstructionObjectSource.Inline) if (includeSource)
sb.Append(Value ?? "NULL");
else
sb.Append(Source);
if (TableIndex != -1)
{ {
sb.Append('['); if (Source == InstructionObjectSource.Inline)
sb.Append(TableIndex); sb.Append(Value ?? "NULL");
sb.Append(']'); else
sb.Append(Source);
if (TableIndex != -1)
{
sb.Append('[');
sb.Append(TableIndex);
sb.Append(']');
}
}
else
{
sb.Append(Value ?? "NULL");
} }
} }
} }