Skip to content

Commit

Permalink
toml: Fix #21 by allowing EOS to terminate a comment + add a test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElectronWill committed Jun 8, 2017
1 parent 4991f95 commit 079b390
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ static int readNonSpace(CharacterInput input, boolean skipNewlines) {
}

/**
* Reads all the characters before the next newline.
* Reads all the characters before the next newline or the end of the data.
*/
static CharsWrapper readLine(CharacterInput input) {
return input.readCharsUntil(NEWLINE);
return input.readUntil(NEWLINE);
}

static boolean isValidInBareKey(char c, boolean lenient) {
Expand Down
4 changes: 3 additions & 1 deletion toml/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ Second line'''
name = "banana"

[[fruit.variety]]
name = "plantain"
name = "plantain"

# Comment at the end of the file

0 comments on commit 079b390

Please sign in to comment.