Commit graph

11 commits

Author SHA1 Message Date
Eric Huss d31787fa3b Merge pull request #373 from mgsloan/allow-empty-table-keys
Allow empty table keys
2021-04-26 13:32:09 -07:00
Alex Tokarev 39dcf1384c Improve error message when parsing unquoted string (#385)
* Improve error message when parsing unquoted string

* Remove conversion to lowercase in parse_keylike()

Converting keys to lowercase goes against
TOML specification for floats.

* Change error message for unquoted string
2020-10-11 12:30:55 -05:00
Michael Sloan 6de25e7cc8 Allow empty table keys
Quoting 68076ffc6d (user-content-keys)

> A bare key must be non-empty, but an empty quoted key is allowed (though discouraged).

See also the discussion in https://github.com/toml-lang/toml/issues/432
2020-01-31 00:17:55 -07:00
Eric Huss f822f4661b Allow zero-prefixed float exponents. (#322) 2019-08-23 09:55:15 -07:00
Andres Suarez b09bb78352 Add line and column to all Errors 2019-07-30 13:35:08 -04:00
Andres Suarez 8c1b49f66f Show "column" in Error messages 2019-07-28 13:41:17 -04:00
Andres Suarez 8820659431 Fully expand error messages in tests 2019-07-28 12:58:26 -04:00
Eric Huss 8f115c98d3 cargo fmt 2019-05-08 17:45:39 -07:00
Eric Huss b7493c9bef Fix case sensitivity with T, Z, and E. 2019-02-19 10:59:42 -08:00
rhysd 935d95ce4f Fix multi-line strings are not allowed for key
In spec https://github.com/toml-lang/toml#keys

Quoted keys are clarified as

> he exact same rules as either basic strings or literal strings

TOML clearly distinguishes basic string and multi-line basic string
(literal string is also).

https://github.com/toml-lang/toml#string

So table key and quoted key should not allow multi-line basic string
and multi-line literal string.

ABNF definition also describes that.

https://github.com/toml-lang/toml/blob/master/toml.abnf

```
string = ml-basic-string / basic-string / ml-literal-string / literal-string

quoted-key = basic-string / literal-string
```

`string` contains `ml-*` but `quoted-key` doesn't.
2018-09-25 16:33:52 +09:00
David Tolnay cdb1bfd237 Move tests into their own crate 2017-11-12 19:33:11 -08:00
Renamed from tests/parser.rs (Browse further)