mirror of
https://github.com/irmen/prog8.git
synced 2024-11-02 22:04:40 +00:00
slightly improve error message for unknown module import
This commit is contained in:
parent
d4513364fb
commit
3cc7ad7d20
@ -39,7 +39,7 @@ private fun compileMain(args: Array<String>): Boolean {
|
|||||||
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watches for file changes), greatly increases compilation speed")
|
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watches for file changes), greatly increases compilation speed")
|
||||||
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
||||||
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler, currently '${C64Target.name}' and '${Cx16Target.name}' available").default(C64Target.name)
|
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler, currently '${C64Target.name}' and '${Cx16Target.name}' available").default(C64Target.name)
|
||||||
val sourceDirs by cli.option(ArgType.String, fullName="srcdirs", description = "list of extra paths to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
val sourceDirs by cli.option(ArgType.String, fullName="srcdirs", description = "list of extra paths, separated with ${File.pathSeparator}, to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
||||||
val moduleFiles by cli.argument(ArgType.String, fullName = "modules", description = "main module file(s) to compile").multiple(999)
|
val moduleFiles by cli.argument(ArgType.String, fullName = "modules", description = "main module file(s) to compile").multiple(999)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -33,7 +33,7 @@ class ModuleImporter(private val program: Program,
|
|||||||
val srcPath = when (candidates.size) {
|
val srcPath = when (candidates.size) {
|
||||||
0 -> return Err(NoSuchFileException(
|
0 -> return Err(NoSuchFileException(
|
||||||
file = filePath.normalize().toFile(),
|
file = filePath.normalize().toFile(),
|
||||||
reason = "searched in $searchIn"))
|
reason = "Searched in $searchIn"))
|
||||||
1 -> candidates.first()
|
1 -> candidates.first()
|
||||||
else -> candidates.first() // when more candiates, pick the one from the first location
|
else -> candidates.first() // when more candiates, pick the one from the first location
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ class ModuleImporter(private val program: Program,
|
|||||||
importModule(it)
|
importModule(it)
|
||||||
},
|
},
|
||||||
failure = {
|
failure = {
|
||||||
errors.err("no module found with name $moduleName", import.position)
|
errors.err("no module found with name $moduleName. Searched in: $sourcePaths (and internal libraries)", import.position)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user