diff --git a/il65/examples/test.ill b/il65/examples/test.ill index e1495c2e6..f4154154c 100644 --- a/il65/examples/test.ill +++ b/il65/examples/test.ill @@ -3,8 +3,14 @@ %import c64lib -~ main $c003 { +~ not_main $d000 { + const float len1 = 111 ;len([1,2,3]) + const float round1 = 111 ;len([1,2,3]) + const float sin1 = 111 ;len([1,2,3]) + float cos1 = 111 ;len([1,2,3]) +} +~ main $c003 { const word len1 = len([1,2,3,wa1, wa2, ws1, all1]) const word wa1 = ceil(abs(-999.22)) const byte wa2 = abs(-99) @@ -145,10 +151,6 @@ some_label_def: A=44 %asmbinary "derp", 0, 200 } -%option enable_floats -%option enable_floats -%option enable_floats - %import imported %import imported %import imported2 diff --git a/il65/src/il65/ast/AstIdentifiersChecker.kt b/il65/src/il65/ast/AstIdentifiersChecker.kt index 9422ecb10..5385d2938 100644 --- a/il65/src/il65/ast/AstIdentifiersChecker.kt +++ b/il65/src/il65/ast/AstIdentifiersChecker.kt @@ -53,6 +53,10 @@ class AstIdentifiersChecker : IAstProcessor { } override fun process(decl: VarDecl): IStatement { + if(BuiltinFunctionNames.contains(decl.name)) + // the builtin functions can't be redefined + checkResult.add(NameError("builtin function cannot be redefined", decl.position)) + val scopedName = decl.scopedname.joinToString(".") val existing = symbols[scopedName] if(existing!=null) { diff --git a/il65/src/il65/compiler/Compiler.kt b/il65/src/il65/compiler/Compiler.kt index ec8b86256..c34ed1004 100644 --- a/il65/src/il65/compiler/Compiler.kt +++ b/il65/src/il65/compiler/Compiler.kt @@ -30,7 +30,7 @@ fun Number.toHex(): String { } -data class Mflpt5(val b0: Short, val b1: Short, val b2: Short, val b3: Short, val b4: Short){ +data class Mflpt5(val b0: Short, val b1: Short, val b2: Short, val b3: Short, val b4: Short) { companion object { val zero = Mflpt5(0, 0,0,0,0)