mirror of
https://github.com/irmen/prog8.git
synced 2025-04-09 00:37:15 +00:00
simplify
This commit is contained in:
parent
3770a4fe0c
commit
1dc412eb90
@ -881,6 +881,9 @@ main {
|
||||
DataType.UWORD.isWord shouldBe true
|
||||
DataType.BYTE.isByte shouldBe true
|
||||
DataType.UBYTE.isByte shouldBe true
|
||||
DataType.BOOL.isBool shouldBe true
|
||||
DataType.STR.isString shouldBe true
|
||||
DataType.FLOAT.isFloat shouldBe true
|
||||
|
||||
DataType.forDt(BaseDataType.UNDEFINED).isUndefined shouldBe true
|
||||
DataType.forDt(BaseDataType.LONG).isLong shouldBe true
|
||||
@ -888,6 +891,9 @@ main {
|
||||
DataType.forDt(BaseDataType.UWORD).isWord shouldBe true
|
||||
DataType.forDt(BaseDataType.BYTE).isByte shouldBe true
|
||||
DataType.forDt(BaseDataType.UBYTE).isByte shouldBe true
|
||||
DataType.forDt(BaseDataType.BOOL).isBool shouldBe true
|
||||
DataType.forDt(BaseDataType.STR).isString shouldBe true
|
||||
DataType.forDt(BaseDataType.FLOAT).isFloat shouldBe true
|
||||
|
||||
DataType.arrayFor(BaseDataType.UBYTE, true).isUnsignedByteArray shouldBe true
|
||||
DataType.arrayFor(BaseDataType.FLOAT).isFloatArray shouldBe true
|
||||
|
@ -24,7 +24,7 @@ Future Things and Ideas
|
||||
in certain situations (need examples!), the "wrong" order of evaluation of function call arguments is done which results
|
||||
in overwriting registers that already got their value, which requires a lot of stack juggling (especially on plain 6502 cpu!)
|
||||
Maybe this routine can be made more intelligent. See usesOtherRegistersWhileEvaluating() and argumentsViaRegisters().
|
||||
- Does it make codegen easier if everything is an expression? Start with the PtProgram ast , get rid of the statements there -> expressions that have Void data type
|
||||
- Does it make codegen easier if everything is an expression? Start with the PtProgram ast classes, change statements to expressions that have (new) VOID data type
|
||||
- Can we support signed % (remainder) somehow?
|
||||
- Multidimensional arrays and chained indexing, purely as syntactic sugar over regular arrays. Probaby only useful if we have typed pointers.
|
||||
- make a form of "manual generics" possible like: varsub routine(T arg)->T where T is expanded to a specific type
|
||||
|
@ -31,10 +31,7 @@ sealed class PtNode(val position: Position) {
|
||||
}
|
||||
|
||||
|
||||
sealed interface IPtStatementContainer
|
||||
|
||||
|
||||
class PtNodeGroup : PtNode(Position.DUMMY), IPtStatementContainer
|
||||
class PtNodeGroup : PtNode(Position.DUMMY)
|
||||
|
||||
|
||||
sealed class PtNamedNode(var name: String, position: Position): PtNode(position) {
|
||||
@ -79,7 +76,7 @@ class PtBlock(name: String,
|
||||
val source: SourceCode, // taken from the module the block is defined in.
|
||||
val options: Options,
|
||||
position: Position
|
||||
) : PtNamedNode(name, position), IPtStatementContainer {
|
||||
) : PtNamedNode(name, position) {
|
||||
class Options(val address: UInt? = null,
|
||||
val forceOutput: Boolean = false,
|
||||
val noSymbolPrefixing: Boolean = false,
|
||||
|
@ -62,7 +62,7 @@ class PtSub(
|
||||
val parameters: List<PtSubroutineParameter>,
|
||||
val returns: List<DataType>,
|
||||
position: Position
|
||||
) : PtNamedNode(name, position), IPtSubroutine, IPtStatementContainer {
|
||||
) : PtNamedNode(name, position), IPtSubroutine {
|
||||
init {
|
||||
// params and return values should not be str
|
||||
if(parameters.any{ !it.type.isNumericOrBool })
|
||||
@ -227,7 +227,7 @@ class PtWhenChoice(val isElse: Boolean, position: Position) : PtNode(position) {
|
||||
}
|
||||
|
||||
|
||||
class PtDefer(position: Position): PtNode(position), IPtStatementContainer
|
||||
class PtDefer(position: Position): PtNode(position)
|
||||
|
||||
|
||||
class PtJmpTable(position: Position) : PtNode(position) // contains only PtIdentifier nodes
|
||||
|
Loading…
x
Reference in New Issue
Block a user