mirror of
https://github.com/KarolS/millfork.git
synced 2024-12-23 23:30:22 +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)
|
||||
Some(size)
|
||||
} 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)
|
||||
addThing(t, stmt.position)
|
||||
var value = Constant.Zero
|
||||
|
Loading…
Reference in New Issue
Block a user