Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parse of TOML example #22

Closed
ruckustboom opened this issue Jul 27, 2017 · 6 comments
Closed

Incorrect parse of TOML example #22

ruckustboom opened this issue Jul 27, 2017 · 6 comments
Assignees
Milestone

Comments

@ruckustboom
Copy link

When parsing a file (like this one for example) with CRLF endings, comments retain the CR at the end, but not the LF.

@ruckustboom
Copy link
Author

This means that, among other things, the parsed config cannot be written back out. The splitLines(String, List<String>) function only checks if the current character is a CR. It then writes the current line and updates the position to be after the assumed LF. However, since the CR was the last character and there is no LF, the final statement fails (pos0 is now greater than str.length()).

@TheElectronWill
Copy link
Owner

Thanks for reporting this!
Indeed, the parser should not retain the CR at the end of the line. I think I've got a fix, just need to test it... I'll push it in the next days.

@TheElectronWill TheElectronWill modified the milestones: v2.1.3 stable, v3.0 Jul 28, 2017
@TheElectronWill
Copy link
Owner

TheElectronWill commented Aug 1, 2017

This should have been fixed by the modifications in Toml.java in commit f54fb3d (master branch)
Tell me if you've still got problems.

@ruckustboom
Copy link
Author

Awesome, thanks for the quick response. Any estimate on when to expect the 2.1.3 release?

@TheElectronWill
Copy link
Owner

I've nearly finished. It should be ready later today or tomorrow morning :-)

@ruckustboom
Copy link
Author

Awesome, thanks!

TheElectronWill added a commit that referenced this issue Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants