bitwalker / toml-elixir

An implementation of TOML for Elixir projects, compliant with the latest specification
Apache License 2.0
200 stars 24 forks source link

DateTime as first value in table list throws UndefinedError #22

Open mradke opened 4 years ago

mradke commented 4 years ago

When structuring a toml file as:

[[entries]]
in = 2019-10-16T13:30:00Z
out = 2019-10-16T17:00:00Z
tags = [
  "Elixir"
]

The parser fails with: {:error, "%Protocol.UndefinedError{description: \"\", protocol: Enumerable, value: ~U[2019-10-16 13:30:00Z]}"}

When I change the order in the table list as such:

[[entries]]
tags = [
  "Elixir"
]
in = 2019-10-16T13:30:00Z
out = 2019-10-16T17:00:00Z

The parser is happy. 🙂 Any pointers where I could start looking? (I would like to provide a patch for this)

xsteve commented 3 months ago

I can confirm that problem - and the work around to re-order the entries and put the date not as first assignment in the entries list It would be nice to see that fixed.