Skip to content

Commit 1dce299

Browse files
committed
fix(debugging): print a newline after the last line too
1 parent 65ea545 commit 1dce299

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/main/java/org/byteskript/skript/compiler/DebugSkriptCompiler.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ protected void compileLine(String line, FileContext context) {
4141
public PostCompileClass[] compile(InputStream stream, Type path) {
4242
this.stream.print("\n");
4343
this.stream.print("--" + path.internalName());
44-
this.stream.print("\n");
44+
this.stream.print("\n\n");
4545
return super.compile(stream, path);
4646
}
4747

4848
@Override
4949
public PostCompileClass[] compile(String source, Type path) {
50-
this.stream.print("\n\n");
51-
this.stream.print("--" + path.internalName());
5250
this.stream.print("\n");
51+
this.stream.print("--" + path.internalName());
52+
this.stream.print("\n\n");
5353
return super.compile(source, path);
5454
}
5555

@@ -59,9 +59,8 @@ protected FileContext createContext(Type path) {
5959
}
6060

6161
protected void debug(ElementTree tree, FileContext context) {
62-
this.stream.print("\n");
6362
for (int i = 0; i < context.lineIndent; i++) this.stream.print("\t");
64-
this.stream.print(tree.toString(context));
63+
this.stream.println(tree.toString(context));
6564
}
6665

6766
}

src/test/java/org/byteskript/skript/test/SyntaxTreeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function test (a, b):
4747
""", new Type("test"));
4848
assert stream.toString().equals("""
4949
50-
5150
--test
5251
5352
MemberDictionary():
@@ -68,7 +67,8 @@ function test (a, b):
6867
6968
EventLoad():
7069
EntryTriggerSection():
71-
EffectPrint(StringLiteral("Foo"))""") : '"' + stream.toString() + '"';
70+
EffectPrint(StringLiteral("Foo"))
71+
""") : '"' + stream.toString() + '"';
7272
}
7373

7474
}

0 commit comments

Comments
 (0)