From e166329f3499c3a4c642ccbb7532a7001b6bba85 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Mon, 28 Mar 2022 01:38:01 +0200 Subject: [PATCH] fix error for certain typecasted expressions inside comparisons --- .../src/prog8/compiler/astprocessing/AstExtensions.kt | 9 +++++++-- docs/source/todo.rst | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/compiler/src/prog8/compiler/astprocessing/AstExtensions.kt b/compiler/src/prog8/compiler/astprocessing/AstExtensions.kt index 05267ee0e..3be4278bb 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstExtensions.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstExtensions.kt @@ -107,8 +107,13 @@ internal fun Program.checkIdentifiers(errors: IErrorReporter, options: Compilati internal fun Program.variousCleanups(errors: IErrorReporter, options: CompilationOptions) { val process = VariousCleanups(this, errors, options) process.visit(this) - if(errors.noErrors()) - process.applyModifications() + if(errors.noErrors()) { + if(process.applyModifications()>0) { + process.visit(this) + if(errors.noErrors()) + process.applyModifications() + } + } } internal fun Program.moveMainAndStartToFirst() { diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 02803f9b0..97461d91b 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,15 +3,17 @@ TODO For next release ^^^^^^^^^^^^^^^^ -- vm codegen: ForLoop - vm codegen: fix primes endless loop stuck on '2' -- x16: screen_set_mode -> screen_mode + other api https://github.com/commanderx16/x16-docs/blob/master/Commander%20X16%20Programmer's%20Reference%20Guide.md#function-name-screen_mode +- x16: check joystick support (petaxian, own stuff) because of api change in r39 kernal https://github.com/commanderx16/x16-docs/blob/master/Commander%20X16%20Programmer's%20Reference%20Guide.md#function-name-joystick_get +- x16: screen_set_mode -> screen_mode + other args https://github.com/commanderx16/x16-docs/blob/master/Commander%20X16%20Programmer's%20Reference%20Guide.md#function-name-screen_mode - optimize diskio load_raw on X16 because headerless files are now supported https://github.com/commanderx16/x16-rom/pull/216 note: must still work on c64/c128 that don't have this! - major version bump once X16 r39 rom is officially finalized +- vm codegen: ForLoop - vm codegen: When - vm codegen: Pipe expression - vm codegen: validate that PtFunctionCall translation works okay with resultregister +- vm codegen: postincrdecr arrayvalue - vm: support no globals re-init option - vm codegen/assembler: variable memory locations should also be referenced by the variable name instead of just the address - when the vm is stable and *if* its language can get promoted to prog8 IL, the variable allocation should be changed.