mindcode icon indicating copy to clipboard operation
mindcode copied to clipboard

Optimizer - condense constants into a single string

Open tom-leys opened this issue 5 months ago • 9 comments

When the compiler (or previous optimization steps in this case) outputs this MLOG

print "Reactor "
print 1
print " in emergency shutdown mode\n"

The optimizer should condense it to

print "Reactor 1 in emergency shutdown mode\n"

This was the result of unrolling a loop which calls a function (now with a constant) and printfs in that function.

The full example is here #136

tom-leys avatar Sep 04 '24 21:09 tom-leys