From 08522ea706b0e8b883a3cec97755e4e6dc562788 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 12 Apr 2026 10:03:40 +0100 Subject: Don't print null sources for errors --- src/main/java/org/shedlang/compiler/cli/ShedCli.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/shedlang/compiler/cli/ShedCli.java b/src/main/java/org/shedlang/compiler/cli/ShedCli.java index e4f98607..7f6d88ad 100644 --- a/src/main/java/org/shedlang/compiler/cli/ShedCli.java +++ b/src/main/java/org/shedlang/compiler/cli/ShedCli.java @@ -8,6 +8,7 @@ import org.shedlang.compiler.ShedCompiler; import org.shedlang.compiler.backends.Backends; import org.shedlang.compiler.backends.ShedTarget; import org.shedlang.compiler.errors.CompilerError; +import org.shedlang.compiler.sources.NullSource; import java.io.IOException; import java.nio.file.Path; @@ -19,7 +20,9 @@ public class ShedCli { try { compile(args); } catch (CompilerError error) { - System.err.println(error.source().describe()); + if (!(error.source() instanceof NullSource)) { + System.err.println(error.source().describe()); + } System.err.println(error.getMessage()); System.exit(2); } -- cgit v1.2.3