Escape invisible character is debug mode

This commit is contained in:
Stone_Red
2024-08-08 23:57:40 +02:00
parent ec2f294796
commit 9a6f1d7806
6 changed files with 42 additions and 34 deletions
+8 -3
View File
@@ -203,12 +203,17 @@ internal class TextEditor
return padding;
}
private static string ToLiteral(string input)
{
return Microsoft.CodeAnalysis.CSharp.SymbolDisplay.FormatLiteral(input, false);
}
private void YesNtInterpreter_OnDebugOutput(string output)
{
debugOutput.Add(output);
}
private void YesNtInterpreter_OnLineExecuted(Interpreter.Runtime.DebugEventArgs e)
private void YesNtInterpreter_OnLineExecuted(DebugEventArgs e)
{
lock (Console.Out)
{
@@ -221,11 +226,11 @@ internal class TextEditor
if (e.OriginalLine == e.CurrentLine)
{
Console.WriteLine($"{sharedString}[{e.CurrentLine}] ==>");
Console.WriteLine($"{sharedString}[{ToLiteral(e.CurrentLine)}] ==>");
}
else
{
Console.WriteLine($"{sharedString}[{e.OriginalLine}] => [{e.CurrentLine}] ==>");
Console.WriteLine($"{sharedString}[{ToLiteral(e.OriginalLine)}] => [{ToLiteral(e.CurrentLine)}] ==>");
}
Console.ForegroundColor = ConsoleColor.Gray;
}
+4
View File
@@ -10,6 +10,10 @@
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\YesNt.Interpreter\YesNt.Interpreter.csproj" />
</ItemGroup>