Skip to content

Commit

Permalink
Handle EOF in the comment lexing function
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbaturin committed Apr 15, 2024
1 parent 9cd6575 commit 970e114
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Carriage return characters now work correctly in multi-line strings,
so files produced on Windows with CRLF newlines are parsed correctly
(report by Bohdan Kolesnikov)
* Files that consists of a single comment without a newline are handled correctly now.
* Correct use of custom inequality functions in the example from the README (patch by Yawar Amin)

## 1.0.4
Expand Down
1 change: 1 addition & 0 deletions src/lib/toml_lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ and read_comment state buf =
in
token state lexbuf
}
| eof { token state lexbuf }
| [^ '\n' '\x00'-'\x08' '\x0B'-'\x1F' '\x7F']+
{ Buffer.add_string buf (Lexing.lexeme lexbuf); read_comment state buf lexbuf }

Expand Down

0 comments on commit 970e114

Please sign in to comment.