mirror of
https://github.com/irmen/prog8.git
synced 2024-10-18 01:24:51 +00:00
array literal const check added
This commit is contained in:
parent
f1ee3b4e60
commit
9b66a597bb
@ -1 +1 @@
|
|||||||
4.2
|
4.3-SNAPSHOT
|
||||||
|
@ -742,6 +742,11 @@ internal class AstChecker(private val program: Program,
|
|||||||
checkValueTypeAndRangeArray(array.type.typeOrElse(DataType.STRUCT), null, arrayspec, array)
|
checkValueTypeAndRangeArray(array.type.typeOrElse(DataType.STRUCT), null, arrayspec, array)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!array.value.all { it.constValue(program)!=null }) {
|
||||||
|
// TODO for now, array literals have to consist of all compile time constant values...
|
||||||
|
errors.err("array literal doesn't consist of only compile time constant values", array.position)
|
||||||
|
}
|
||||||
|
|
||||||
super.visit(array)
|
super.visit(array)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1098,7 +1103,7 @@ internal class AstChecker(private val program: Program,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(value.type.isUnknown)
|
if(value.type.isUnknown)
|
||||||
return err("attempt to check values of array with as yet unknown datatype")
|
return false
|
||||||
|
|
||||||
when (targetDt) {
|
when (targetDt) {
|
||||||
DataType.STR -> return err("string value expected")
|
DataType.STR -> return err("string value expected")
|
||||||
|
@ -5,6 +5,7 @@ TODO
|
|||||||
- get rid of all other TODO's in the code ;-)
|
- get rid of all other TODO's in the code ;-)
|
||||||
- line-circle-gfx examples are now a few hundred bytes larger than before. Why is that, can it be fixed?
|
- line-circle-gfx examples are now a few hundred bytes larger than before. Why is that, can it be fixed?
|
||||||
- compiler errors and warnings in standard format so the IDE shows them as clickable links; ./test.asm:2578:3: blablabla
|
- compiler errors and warnings in standard format so the IDE shows them as clickable links; ./test.asm:2578:3: blablabla
|
||||||
|
- make it possible for array literals to not only contain compile time constants
|
||||||
- further optimize assignment codegeneration
|
- further optimize assignment codegeneration
|
||||||
- auto select correct library to import based on target, instead of having c64- and cx16- prefix variants
|
- auto select correct library to import based on target, instead of having c64- and cx16- prefix variants
|
||||||
- implement @stack for asmsub parameters
|
- implement @stack for asmsub parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user