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

ParsingException when the last line is a comment #21

Closed
guai opened this issue Jun 6, 2017 · 0 comments
Closed

ParsingException when the last line is a comment #21

guai opened this issue Jun 6, 2017 · 0 comments
Assignees

Comments

@guai
Copy link

guai commented Jun 6, 2017

ver 2.1

Exception in thread "main" com.electronwill.nightconfig.core.io.ParsingException: Not enough data available
	at com.electronwill.nightconfig.core.io.ParsingException.notEnoughData(ParsingException.java:22)
	at com.electronwill.nightconfig.core.io.ReaderInput.directReadChar(ReaderInput.java:36)
	at com.electronwill.nightconfig.core.io.AbstractInput.readChar(AbstractInput.java:49)
	at com.electronwill.nightconfig.core.io.AbstractInput.readCharsUntil(AbstractInput.java:123)
	at com.electronwill.nightconfig.toml.Toml.readLine(Toml.java:63)
	at com.electronwill.nightconfig.toml.Toml.readUseful(Toml.java:36)
	at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:51)
	at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:99)
	at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:76)
	at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:31)
	at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:23)
	at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:103)

being thrown when the toml file contains this two lines at the very end:

#[geometry]
#	disabled = false

with no newline after them
In case when there is a newline - it's ok.

@TheElectronWill TheElectronWill self-assigned this Jun 6, 2017
TheElectronWill added a commit that referenced this issue Jun 8, 2017
@TheElectronWill TheElectronWill changed the title ParsingException ParsingException when the last line is a comment Jun 8, 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