diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt index 762bb4029..5da841549 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt @@ -1437,15 +1437,6 @@ internal class AstChecker(private val program: Program, val elementDt = containment.element.inferType(program) val iterableDt = containment.iterable.inferType(program) - if(compilerOptions.compTarget.name!=VMTarget.NAME) { - val parentBinexpr = containment.parent as? BinaryExpression - if(parentBinexpr!=null) { - // only supported if compared to 1 or 0, more complex expressions aren't supported in the 6502 code-gen. - if(parentBinexpr.operator!="==" || parentBinexpr.right.constValue(program)?.number !in listOf(0.0, 1.0)) - errors.err("containment check is currently not supported inside complex expressions", containment.position) - } - } - if (iterableDt.isIterable) { if (containment.iterable !is RangeExpression) { val iterableEltDt = ArrayToElementTypes.getValue(iterableDt.getOr(DataType.UNDEFINED)) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index e8ea637fd..ebb95291c 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,8 +1,6 @@ TODO ==== -fix containment check is currently not supported inside complex expressions - ... diff --git a/examples/test.p8 b/examples/test.p8 index 3cbc66110..e2d7220cb 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,35 +1,15 @@ -%import math -%import monogfx +%import textio +%zeropage basicsafe +%option no_sysinit main { sub start() { - monogfx.lores() - monogfx.drawmode(monogfx.MODE_INVERT) + str name = "irmen" + ubyte @shared cc='m' - uword x1, x2 - uword y1, y2 + cx16.r0=9999 - repeat 200 { - x1 = math.rnd() - y1 = math.rnd() % 240 - x2 = math.rnd() - y2 = math.rnd() % 240 - monogfx.line(x1, y1, x2, y2, true) - } - - repeat 5 { - for cx16.r9L in 0 to 200 { - monogfx.vertical_line(cx16.r9L, 10, 200, true) - } - } - - - monogfx.disc(160, 120, 100, true) - monogfx.fillrect(20, 100, 280, 50, true) - monogfx.drawmode(monogfx.MODE_STIPPLE) - monogfx.fillrect(80, 10, 50, 220, true) - - repeat { - } + if cx16.r0<10000 and 'q' in name + txt.print("yes") } }