This problem occurs on Linux/WSL2 only, running the test on native Windows, all examples are parsed correctly. Seems related to issue #13: "Add support for CR and CRLF newlines".
With CRLF line ending this parses correctly:
[test]
key = "test"
This fails with CRLF-endings, but parses correctly with LF (unixy) line endings.
[[test]]
key = "test"
TOML.load_file('/home/eflukx/delme.toml')"
Traceback (most recent call last):
5: from -e:1:in `<main>'
4: from /home/eflukx/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/toml-0.3.0/lib/toml.rb:23:in `load_file'
3: from /home/eflukx/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/toml-0.3.0/lib/toml.rb:23:in `new'
2: from /home/eflukx/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/toml-0.3.0/lib/toml/parser.rb:9:in `initialize'
1: from /home/eflukx/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/parslet-2.0.0/lib/parslet/atoms/base.rb:49:in `parse'
/home/eflukx/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/parslet-2.0.0/lib/parslet/cause.rb:70:in `raise': Failed to match sequence (ALL_SPACE (COMMENT_LINE / TABLE / TABLE_ARRAY / KEY_VALUE){0, } ALL_SPACE) at line 1 char 1. (Parslet::ParseFailed)
This problem occurs on Linux/WSL2 only, running the test on native Windows, all examples are parsed correctly. Seems related to issue #13: "Add support for CR and CRLF newlines".
With
CRLF
line ending this parses correctly:This fails with
CRLF
-endings, but parses correctly withLF
(unixy) line endings.