mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 01:29:28 +00:00
tweak to fix for windows line ending (\r\n) parse errors
This commit is contained in:
parent
61d1f1ea87
commit
0032235933
@ -41,7 +41,7 @@ class ModuleImporter {
|
||||
if(!Files.isReadable(filePath))
|
||||
throw ParsingFailedError("No such file: $filePath")
|
||||
|
||||
val content = Files.readAllBytes(filePath).toString(Charsets.UTF_8).replace("\r\n", "\n")
|
||||
val content = filePath.toFile().readText().replace("\r\n", "\n")
|
||||
return importModule(program, CharStreams.fromString(content), filePath, false, encoder, compilationTargetName)
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ class ModuleImporter {
|
||||
val (resource, resourcePath) = rsc
|
||||
resource.use {
|
||||
println("importing '$moduleName' (library)")
|
||||
val content = it.readAllBytes().toString(Charsets.UTF_8).replace("\r\n", "\n")
|
||||
val content = it.reader().readText().replace("\r\n", "\n")
|
||||
importModule(program, CharStreams.fromString(content), Paths.get("@embedded@/$resourcePath"),
|
||||
true, encoder, compilationTargetName)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user