Skip to content

Commit

Permalink
Merge pull request #18 from bluelhf/master
Browse files Browse the repository at this point in the history
Newline fixes to compiler debug logs
  • Loading branch information
Moderocky authored Oct 14, 2023
2 parents 65ea545 + 1dce299 commit 90f6117
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ protected void compileLine(String line, FileContext context) {
public PostCompileClass[] compile(InputStream stream, Type path) {
this.stream.print("\n");
this.stream.print("--" + path.internalName());
this.stream.print("\n");
this.stream.print("\n\n");
return super.compile(stream, path);
}

@Override
public PostCompileClass[] compile(String source, Type path) {
this.stream.print("\n\n");
this.stream.print("--" + path.internalName());
this.stream.print("\n");
this.stream.print("--" + path.internalName());
this.stream.print("\n\n");
return super.compile(source, path);
}

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

protected void debug(ElementTree tree, FileContext context) {
this.stream.print("\n");
for (int i = 0; i < context.lineIndent; i++) this.stream.print("\t");
this.stream.print(tree.toString(context));
this.stream.println(tree.toString(context));
}

}
4 changes: 2 additions & 2 deletions src/test/java/org/byteskript/skript/test/SyntaxTreeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function test (a, b):
""", new Type("test"));
assert stream.toString().equals("""
--test
MemberDictionary():
Expand All @@ -68,7 +67,8 @@ function test (a, b):
EventLoad():
EntryTriggerSection():
EffectPrint(StringLiteral("Foo"))""") : '"' + stream.toString() + '"';
EffectPrint(StringLiteral("Foo"))
""") : '"' + stream.toString() + '"';
}

}

0 comments on commit 90f6117

Please sign in to comment.