From b6e795c350e2acdc1d2f72ed17813f08e0e6aef8 Mon Sep 17 00:00:00 2001 From: Tobias Stamann Date: Thu, 4 Apr 2024 11:33:51 +0200 Subject: [PATCH] [#87] Reworked debug output of compiler messages - fixed NPE for source code unrelated compiler messages --- .../src/main/java/io/toolisticon/cute/DebugOutputGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cute/src/main/java/io/toolisticon/cute/DebugOutputGenerator.java b/cute/src/main/java/io/toolisticon/cute/DebugOutputGenerator.java index f364505..b5a6e0b 100644 --- a/cute/src/main/java/io/toolisticon/cute/DebugOutputGenerator.java +++ b/cute/src/main/java/io/toolisticon/cute/DebugOutputGenerator.java @@ -139,7 +139,7 @@ private static String getDebugMessages(CompilationResult compilationResult, Diag private static String getDiagnosticString(Diagnostic diagnostics) { return "[ " + diagnostics.getKind() + ", " - + "s:'" + diagnostics.getSource().getName() + "', " + + "s:" + ( diagnostics.getSource() != null ? "'" + diagnostics.getSource().getName() + "'" : "") + ", " + "l:" + diagnostics.getLineNumber() + ", " + "c:" + diagnostics.getColumnNumber()+ " ] " + ":= '" + diagnostics.getMessage(null) + "'";