This commit is contained in:
nub31
2025-09-29 19:04:09 +02:00
parent ecdfd8262d
commit 4252725783
16 changed files with 120 additions and 129 deletions

View File

@@ -0,0 +1,39 @@
using System.Text;
namespace NubLang.Generation;
internal class QBEWriter
{
private readonly StringBuilder _builder = new();
public void Indented(string value)
{
_builder.Append('\t');
_builder.AppendLine(value);
}
public void Comment(string comment)
{
_builder.AppendLine("# " + comment);
}
public void WriteLine(string text)
{
_builder.AppendLine(text);
}
public void Write(string text)
{
_builder.Append(text);
}
public void NewLine()
{
_builder.AppendLine();
}
public override string ToString()
{
return _builder.ToString();
}
}