From d5214e25056aa1438dcfce3008c9995bae328a53 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Fri, 30 Apr 2021 00:16:36 +0200 Subject: [PATCH] fix import paths --- compilerAst/src/prog8/parser/ModuleParsing.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compilerAst/src/prog8/parser/ModuleParsing.kt b/compilerAst/src/prog8/parser/ModuleParsing.kt index 7e9c37e35..edf695e6a 100644 --- a/compilerAst/src/prog8/parser/ModuleParsing.kt +++ b/compilerAst/src/prog8/parser/ModuleParsing.kt @@ -158,8 +158,8 @@ class ModuleImporter(val program: Program, val encoder: IStringEncoding, val com val fileName = "$name.p8" val libpaths = libdirs.map {Path.of(it)} val locations = - (if(source.toString().isEmpty()) libpaths else libpaths.drop(1) + (source.parent ?: Path.of("."))) + - Paths.get(Paths.get("").toAbsolutePath().toString(), "prog8lib") + (if(source.toString().isEmpty()) libpaths else libpaths.drop(1) + listOf(source.parent ?: Path.of("."))) + + listOf(Paths.get(Paths.get("").toAbsolutePath().toString(), "prog8lib")) locations.forEach { val file = pathFrom(it.toString(), fileName)