Heh,
I wouldn't say awesome but I'm beginning to like this visitor
framework more every day because this fix wasn't intrusive at all.
This proves we have it working right; Here is a test that is just plain weird
a = (a + b) - c + d * e;
It now produces;
a = (((a + b) - c) + (d * e))
Notice how it automatically gets the multiply right and deals with the
addition paren first.
I might try to work on that outer paren in an assignment expression
but we could just leave it as is and it would be fine, just adds a bit
more k to a generated file. :)
THere might be some edge cases but I will worry about those later.
Mike
Quoting Erik de Bruin <e...@ixsoftware.nl>:
You're not think 5th dimensionally here;
I rarely venture in such an integer state of mind. I'm more of a
fractal kinda guy :-)
Currently without fixing this bug a use has the expression statement of;
var a = ((a + b) - (c + d)) * e;
They use the compiler, it checks out fine, FalconJx is currently rendering
to JavaScript that will get executed;
var a = a + b - c + d * e;
See a problem here?
Yes, that's why I wrote you that TODO in the test ;-)
I have tested a fix that produces;
var a:* = ((a + b) - (c + d)) * e;
You are awesome! I might have to come visit you in your universe
sometimes, I'm sure you over-hyper-cube-landers can teach me a trick
or two.
Looking forward to you commit,
Have fun!
EdB
--
Ix Multimedia Software
Jan Luykenstraat 27
3521 VB Utrecht
T. 06-51952295
I. www.ixsoftware.nl
--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com