Skip to content

Commit

Permalink
Fix parsing errors not being included in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
stanhebben committed Mar 15, 2024
1 parent 97ae3f5 commit 5fc6f92
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import org.openzen.scriptingenginetester.TestOutput;
import org.openzen.zencode.java.logger.ScriptingEngineStreamLogger;
import org.openzen.zencode.shared.CompileException;
import org.openzen.zenscript.codemodel.compilation.CompileErrors;
import org.openzen.zenscript.lexer.ParseException;
import org.openzen.zenscript.scriptingexample.tests.PrintLogger;
import org.openzen.zenscript.validator.ValidationLogEntry;

Expand All @@ -25,6 +27,12 @@ public void logValidationError(ValidationLogEntry errorEntry) {
exceptions.add(new CompileException(errorEntry.position, errorEntry.error));
}

@Override
public void logParseException(ParseException exception) {
super.logParseException(exception);
exceptions.add(new CompileException(exception.position, CompileErrors.parseError(exception.message)));
}

@Override
public void logPrintln(String line) {
printOutput.add(line);
Expand Down

0 comments on commit 5fc6f92

Please sign in to comment.