Skip to content

Commit

Permalink
Remove extra space on newline
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-kana committed Nov 8, 2024
1 parent 26dba4a commit 468b5f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion GDWeave.Dumper/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

public class CodeGenerator(List<Token> tokens, List<string> identifiers) {
public void Generate(StreamWriter writer) {
var onNewLine = false;
foreach (var token in tokens) {
var tabs = 0u;
var gen = this.GenerateToken(token, ref tabs);

writer.Write(gen + ' ');
onNewLine = gen == "\n";

if (!onNewLine)
{
gen += ' ';
}

writer.Write(gen);

for (var i = 0; i < tabs; i++) {
writer.Write('\t');
Expand Down

0 comments on commit 468b5f5

Please sign in to comment.