zach-cloud / JAST

JASS IDE.
Apache License 2.0
9 stars 0 forks source link

Formatter Failure #48

Open rossoliny opened 3 years ago

rossoliny commented 3 years ago

Formatter breaks logic in when formatting 50 000 lines of code, i got segfault memory acces violation and another bug when map does not even load. I think other bugs possible also.

Also fails and does not even reformat when formatting more than 100 000 lines.

zach-cloud commented 3 years ago

It's an issue with parsing a JASS file into the syntax tree representation. I have an issue here for it: https://github.com/zach-cloud/JSyntaxTree/issues/7 that I'll get around to someday.

The syntax tree parses everything into a logical representation of that item, down to the function argument level. Unfortunately even that small representation of it still stores the value as a String, and eventually with 100k+ objects holding Strings, you get a memory error. I think some level of caching could help. I'd also be interested in best practices implemented in syntax trees used by IDEs like IntelliJ, though I am really busy with work & private projects right now so this stuff has kind of taken a backseat right now.