Carleslc / Simple-YAML

This Java API provides an easy-to-use way to store data and provide configurations using the YAML format.
https://carleslc.me/Simple-YAML
GNU General Public License v3.0
130 stars 38 forks source link

Weird behavior of Side comments #42

Closed HSGamer closed 2 years ago

HSGamer commented 3 years ago

I wrote a program to test the comment feature of YAML

HSGamer commented 3 years ago

Maybe the regex for side comments should be changed

re-ovo commented 2 years ago

When will the next version be released? This bug will cause the configuration file to become more and more bloated and eventually crash

image

Carleslc commented 2 years ago

When will the next version be released? This bug will cause the configuration file to become more and more bloated and eventually crash

Probably in the next days (less than a week).

In the meanwhile, as this is a bug related to the comment parser if you don't need comments at all you can load your file with load instead loadWithComments and this bug will not happen (just make sure you don't have comments in your file because they would be removed).

Carleslc commented 2 years ago

Sorry for the delay, it has involved more work than the thought initially.

Version 1.8 is now released, solving this issue and adding other useful features too.

I've removed the side regex entirely, improving the comment parser to handle quotes and literal strings. The output is now the expected, since having a # in a string value is not an issue anymore.

I'm closing the issue. If you encounter a related problem with this issue or have any doubt feel free to reopen it.