toml-lang / toml-test

A language agnostic test suite for TOML parsers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verify parsers don't mistake trailing whitespace for date/time separator

epage opened this issue · comments

Since my parser combinator library is LL(1) by default, it thought the space between 27 and # was the date / time separator.

foo = 1979-05-27 # Comment

See toml-rs/toml#269

I'm assuming others might run into this and it'd be good to upstream the test case.

There's actually already a test for this: https://github.com/BurntSushi/toml-test/blob/master/tests/valid/comment/everywhere.toml#L27

That has two spaces though, not one, maybe that's why it didn't fail?

Actually not sure if no space (e.g. d = 1979-05-27T07:32:12-07:00# c) is allowed too; I'd have to check.

But in general: if you have a bug like this that isn't caught by the existing tests then a test should be added.