Closed WJWH closed 5 years ago
Reproduced on the current version. investigating.
also reproduced by:
echo ((-)); echo ([-]);
and echo((+));
Perhaps it believes there to be a number following it, causing some sort of infinite recursion? I had a quick look through code and the most likely thing I could find was https://github.com/colah/ImplicitCAD/blob/master/Graphics/Implicit/ExtOpenScad/Parser/Expr.hs#L177, but I must admit I don't know this code (or just Parsec in general) well enough to make a proper fix.
As an aside, this is one of the oldest GH issues I've filed and I think it's super cool that people are looking at it now. Much appreciation for that.
and echo([ for (a = [1 : 4]) [a, a * a] ]);
almost-complete rewrite of the expression parser. quite a bit faster (4-600 times, depending on the test!), and all of these generate syntax errors now.
Problem solved. :)
Trying to compile the following code will cause extopenscad to consume all available memory until it crashes with an "out of memory" error.
Note there being just a minus as the first element of the vector. I believe proper behavior would be to detect this and give a more informative error message.