fix empty file case

This commit is contained in:
ChUrl
2021-01-22 22:07:16 +01:00
parent c99de7dcc5
commit 88eae33df4

View File

@ -118,6 +118,10 @@ public final class CodeGenerator {
}
public StringBuilder generateCode(String source) {
if (!this.tree.getRoot().hasChildren()) {
throw new CodeGenerationException("Empty File can't be compiled");
}
this.generateHeader(source);
this.generateConstructor();
this.generateMain();