diff --git a/compilerAst/src/prog8/parser/ModuleParsing.kt b/compilerAst/src/prog8/parser/ModuleParsing.kt index 87eba5d40..4c0b0a8ef 100644 --- a/compilerAst/src/prog8/parser/ModuleParsing.kt +++ b/compilerAst/src/prog8/parser/ModuleParsing.kt @@ -44,7 +44,10 @@ class ModuleImporter(private val program: Program, if(!Files.isReadable(filePath)) throw ParsingFailedError("No such file: $filePath") - val content = filePath.toFile().readText().replace("\r\n", "\n") + var content = filePath.toFile().readText().replace("\r\n", "\n") // normalize line endings + if(content.last()!='\n') + content+='\n' // grammar requires blocks (and thus module files) to end in an EOL + return importModule(CharStreams.fromString(content), filePath, false) } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index b46914cfd..12084c221 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -4,8 +4,9 @@ TODO - possible idea: option to mark vardecls 'shared' to indicate they should not be optimized away because they're shared with assembly code? However: who even needs variables declared in prog8 code that are only used by assembly??? -- github issue: make strings no longer immutable? Deduplication selectable via command line switch? - IMPROVE DOCUMENTATION ABOUT STRINGS AND DEDUP. +- github issue about strings and their immutability: + StatementOptimizer line 60: only optimize when it's a known constant literal + IMPROVE DOCUMENTATION ABOUT STRINGS AND DEDUP and (NON)IMMUTABILITY. - test all examples before release of the new version