fixed invalid errormessage about memory mapped strings

This commit is contained in:
Irmen de Jong 2020-10-07 01:35:23 +02:00
parent 2b48828179
commit e22b4cbb67
6 changed files with 10 additions and 24 deletions

View File

@ -631,7 +631,7 @@ internal class AstChecker(private val program: Program,
if(decl.datatype==DataType.STR) {
if(decl.value==null)
err("string var must be initialized with a string literal")
if(decl.value !=null && decl.value !is StringLiteralValue)
else if (decl.type==VarDeclType.VAR && decl.value !is StringLiteralValue)
err("string var can only be initialized with a string literal")
}

View File

@ -4,6 +4,8 @@
; TODO add all other Elite's ships, show their name, advance to next ship on keypress
; TODO fix crash
main {
; storage for rotated coordinates

View File

@ -3,6 +3,8 @@
%import floats
%zeropage basicsafe
; TODO fix crash
main {
const uword width = 256
const uword height = 200

View File

@ -3,12 +3,16 @@
%target cx16
%zeropage basicsafe
; TODO fix crash
main {
sub start() {
void cx16.screen_set_mode($80)
cx16.r0=0
void cx16.screen_set_mode(0)
cx16.FB_init()
cx16.GRAPH_init()

View File

@ -8,27 +8,6 @@ main {
str planet_name = "12345678"
sub start() {
&str ms1 = $c000 ; TODO fix invalid error message . what about memory mapped array? memory mapped struct?
c64.OPEN() ; works: function call droppign the value but preserving the statusregister
if_cs
return
ubyte status
status = c64.OPEN() ; open 1,8,0,"$"
if_cs
return
; TODO make this work as well, with the same warning:
ubyte status2 = c64.OPEN() ; open 1,8,0,"$"
if_cs
return
txt.print_ub(status)
txt.print_ub(status2)
txt.print(planet_name)
txt.chrout('\n')

View File

@ -16,8 +16,7 @@ main {
str s1 = "hello"
str s2 = @"screencodes"
&str ms1 = $c000 ; TODO fix invalid error message
&str ms1 = $c000
byte[4] barray
ubyte[4] ubarray