mirror of
https://github.com/KarolS/millfork.git
synced 2024-12-24 15:29:23 +00:00
Enums cant have more than 256 items
This commit is contained in:
parent
1b8a7c9bb3
commit
39a9cde375
@ -694,6 +694,9 @@ class Environment(val parent: Option[Environment], val prefix: String, val cpuFa
|
|||||||
addThing(ConstantThing(stmt.name + ".count", NumericConstant(size, 1), get[Type]("byte")), stmt.position)
|
addThing(ConstantThing(stmt.name + ".count", NumericConstant(size, 1), get[Type]("byte")), stmt.position)
|
||||||
Some(size)
|
Some(size)
|
||||||
} else None
|
} else None
|
||||||
|
if (count.exists(_ > 256)) {
|
||||||
|
log.error(s"Enum `${stmt.name} has more than 256 constants.", stmt.position)
|
||||||
|
}
|
||||||
val t = EnumType(stmt.name, count)
|
val t = EnumType(stmt.name, count)
|
||||||
addThing(t, stmt.position)
|
addThing(t, stmt.position)
|
||||||
var value = Constant.Zero
|
var value = Constant.Zero
|
||||||
|
Loading…
Reference in New Issue
Block a user