mirror of
https://github.com/irmen/prog8.git
synced 2025-11-01 22:16:16 +00:00
start with introducing LONG datatype (32 bits signed integer)
This commit is contained in:
@@ -35,7 +35,7 @@ class ConstantFoldingOptimizer(private val program: Program, private val errors:
|
||||
|
||||
override fun after(numLiteral: NumericLiteral, parent: Node): Iterable<IAstModification> {
|
||||
|
||||
if(numLiteral.type==BaseDataType.LONG) {
|
||||
if(numLiteral.type==BaseDataType.LONG && parent !is Assignment) {
|
||||
// see if LONG values may be reduced to something smaller
|
||||
val smaller = NumericLiteral.optimalInteger(numLiteral.number.toInt(), numLiteral.position)
|
||||
if(smaller.type!=BaseDataType.LONG) {
|
||||
|
||||
Reference in New Issue
Block a user