Interesting find on Edamame: I copied Clojure's core.clj
(about 8k LOC) and commented most of it out. When I tried (e/parse-string-all (slurp "core.clj") {:all true :auto-resolve '{:current clojure.core}})
I got the following error: Execution error (StackOverflowError) at clojure.tools.reader.reader_types.StringReader/read_char (reader_types.clj:51).
It's not a problem for me, I'll just remove what I commented out. But should I open an issue for this anyway?
@kevin.van.rooijen That's weird, since parsing clojure.core is part of the unit tests
It only happens when I comment (most) of the code
comment = ;;
?
Yes
So less code and then a stackoverflow happens?
That's even more weird
If you can make the smallest repro possible we could take a look
I'll take a look
It happens at about 3k lines of comments
Not sure if it's memory bound or something
aha, so maybe there's something with the comment parsing
I think so yes
Probably if there's x amount of comments in a row
If I uncomment everything, it works as expected
It's a real edge case though. Having 3k lines of comments doesn't happen very often
ok cool. that's sufficient as a repro then, just post an issue and I'll take a look. what happens if you put one form in between?
Also I just checked, it has to be 3k in a row
If I put any expression in between it works as expected
That's probably hitting at stack depth limit of 3k then
You can try upping the stack limit to see if that helps:
clojure -J-Xss4m
I'll create an issue on GH. No rush from me whatsoever though
Yeah, now it does work
Can you try with be8fc889656668ffba61547ff58009ee090cb51b
and the original stack depth?
Let me try
That seems to fix it
PR welcome for a test: https://github.com/borkdude/edamame/issues/57
Thanks! :)
I wrote it as fast as I could, in the fear of you writing the test before me