From 132c9a4f9561355e298be14619f61d004447f537 Mon Sep 17 00:00:00 2001 From: Kyle Lin Date: Tue, 19 Apr 2022 11:07:44 +0800 Subject: [PATCH] Compilation: fix crashing when source file is passed with relative path --- .gitignore | 3 ++- src/main/kotlin/org/casc/lang/compilation/Compilation.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 691ee74a..54b77028 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /out/ /local_test/ *.class -*.jar \ No newline at end of file +*.jar +bin/* \ No newline at end of file diff --git a/src/main/kotlin/org/casc/lang/compilation/Compilation.kt b/src/main/kotlin/org/casc/lang/compilation/Compilation.kt index 22c5c4ae..3e978332 100644 --- a/src/main/kotlin/org/casc/lang/compilation/Compilation.kt +++ b/src/main/kotlin/org/casc/lang/compilation/Compilation.kt @@ -32,7 +32,7 @@ class Compilation(private val preference: AbstractPreference) { fun compile() { var panic = false - val sourceFile = preference.sourceFile!! + val sourceFile = preference.sourceFile!!.absoluteFile!! measureTime("Compilation") { if (sourceFile.isDirectory) {