thisismypassport / shrinko8

Shrink (minify) Pico-8 carts, as well as other tools (e..g linting, format conversion)
MIT License
92 stars 7 forks source link

README preserve example doesnt work #28

Closed pancelor closed 11 months ago

pancelor commented 12 months ago

Am I misunderstanding the readme? I can't find a combination of flags that makes something like a,b = circfill, rectfill appear in the output:

--preserve: !circfill, !rectfill
circfill, rectfill = --[[preserve]]circfill, --[[preserve]]rectfill
circfill(10,10,20); circfill(90,90,30)
rectfill(0,0,100,100); rectfill(20,20,40,40)
--preserve: !rnd
rnd = --[[preserve]]rnd
rnd(12)

shrinko8 --minify test.lua - -f lua --no-minify-spaces

circfill, rectfill = circfill, rectfill
circfill(10,10,20) circfill(90,90,30)
rectfill(0,0,100,100) rectfill(20,20,40,40)
a = rnd
a(12)

This doesn't actually affect me, its just a bug(?) I noticed recently.

Notice that it does work for rnd, likely because rnd is (correctly) missing from this list?

thisismypassport commented 12 months ago

Thanks for the report. You're right, it's a bug/regression - I have a test for this, but my poor practice of adding testcases to existing tests made me update the test results to match the regression...