Skip to content

Commit

Permalink
Fix containsErrors being wiped
Browse files Browse the repository at this point in the history
  • Loading branch information
BSteffaniak committed Jul 6, 2023
1 parent 474c8e1 commit 8c3adf1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/flat/Flat.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class Flat {
public static String objectClassType = "class";
public static boolean keepSuperCallInConstructor = false;
private boolean testClasses;
private boolean containsErrors;

public boolean deleteOutputDirectory;

Expand Down Expand Up @@ -234,6 +235,10 @@ public static void main(String[] args) {
try {
flat.compile(args, true);
flat.compileEngine.compile();

if (returnCode == 0 && flat.containsErrors) {
returnCode = 1;
}
} catch (Exception e) {
e.printStackTrace();
returnCode = 1;
Expand Down Expand Up @@ -637,6 +642,7 @@ private void createSyntaxTree(boolean generateCode) {
compileEngine.tree = tree;

if (containsErrors()) {
containsErrors = true;
enableFlag(DRY_RUN);
completed(false);
}
Expand All @@ -649,7 +655,7 @@ private void createSyntaxTree(boolean generateCode) {

log("Number of lines parsed: " + lineCount, true);

if (generateCode) {
if (generateCode && !isFlagEnabled(DRY_RUN)) {
long time = System.currentTimeMillis();
long newTime = time;

Expand Down

0 comments on commit 8c3adf1

Please sign in to comment.