compiler watch mode is a bit more robust now against crashes during compilation

This commit is contained in:
Irmen de Jong 2020-12-27 03:58:41 +01:00
parent e17c18b653
commit efa42d5d96
2 changed files with 4 additions and 5 deletions

View File

@ -57,6 +57,7 @@ private fun compileMain(args: Array<String>) {
if(watchMode) { if(watchMode) {
val watchservice = FileSystems.getDefault().newWatchService() val watchservice = FileSystems.getDefault().newWatchService()
val allImportedFiles = mutableSetOf<Path>()
while(true) { while(true) {
println("Continuous watch mode active. Modules: $moduleFiles") println("Continuous watch mode active. Modules: $moduleFiles")
@ -67,7 +68,9 @@ private fun compileMain(args: Array<String>) {
results.add(compilationResult) results.add(compilationResult)
} }
val allImportedFiles = results.flatMap { it.importedFiles } val allNewlyImportedFiles = results.flatMap { it.importedFiles }
allImportedFiles.addAll(allNewlyImportedFiles)
println("Imported files (now watching:)") println("Imported files (now watching:)")
for (importedFile in allImportedFiles) { for (importedFile in allImportedFiles) {
print(" ") print(" ")

View File

@ -5,13 +5,9 @@
main { main {
;uword cmap = memory("palette", 256*4) ; only use 768 of these, but this allows re-use of the same block that the bmp module allocates
uword num_colors = rnd()
sub start () { sub start () {
txt.chrout('\n')
txt.chrout('\n')
test_stack.test() test_stack.test()
} }