Commit Graph

64 Commits (master)

Author SHA1 Message Date
TheOddGarlic 34db433429 bump hashbrown, fix warnings 2022-08-02 12:42:44 +03:00
Kian-Meng Ang 81e7e22176 Fix typos 2022-07-30 22:11:38 +08:00
Eric Huss a6420b64d5
Merge pull request #373 from mgsloan/allow-empty-table-keys
Allow empty table keys
2021-04-26 13:32:09 -07:00
Alex Tokarev c74293f7a8
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
pyfisch 940fcf9e18
Allow delimiter quotes at the end of multiline strings (#393)
TOML allows (unlike many other formats) up to 2
additonal quotes that are part of the string:

basic = """2 extra quotes -->"""""
literal = '''here too ''''

Changed in TOML v1.0.0-rc.1

See also #392
2020-05-28 10:39:55 -05:00
Michael Sloan f74715cb88 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
Michael Sloan bb675c5f56
Fix roundtripping of \u001f and \u007f in toml string literals (#372) 2020-01-30 08:55:36 +01:00
daubaris 60b874308e Mixed type arrays (#358)
* Added support of mixed-type arrays

* Add tests cases

* Replaced &'static str type for type_ and created a new enum instead

* Restored ArrayMixedType
2019-11-22 10:28:29 -06:00
est31 4673cfd797 Replace the test added by #349 with a bench (#351)
CI environments can be noisy and while the test worked great
locally on my machine, it didn't on the CI environment.
This replaces the test with a (manually tracked) benchmark.
As per https://github.com/alexcrichton/toml-rs/pull/349#issuecomment-546998173
2019-10-29 09:10:15 -05:00
est31 c049b7aaec Decrease deserialization complexity from quadratic to linear (#349)
* Speed up array code

* Speed up map code too

Also add regression test

* Use more obvious closure notation

* Document the builder functions
2019-10-28 10:05:13 -05:00
est31 ec21d604f8 Support for dotted table spans (#340)
* "Support" spans for maps

In toml you can declare maps via {} and via [name].
We can't obtain spans for [] maps but at least we
can emit fake spans to make SpannedValue work.

We also add a regression test.

* Don't regress the inline table case

* Also support arrays
2019-10-28 09:01:23 -05:00
est31 8995cef9d6 Spanned: impl PartialEq, Eq, Hash, PartialOrd, Ord in terms of the value (#344)
* Spanned: impl PartialEq, Eq, Hash, PartialOrd, Ord in terms of the value

This is because we want to be able to index into HashMap<Spanned<String>, T>
with a dummy span and get results where only the content has to match.

* Add Borrow impl

* Add tests
2019-10-25 14:05:31 -05:00
est31 7c9b0a39db Support deserializing spanned keys (#333)
* Store key spans in the deserializer

* Support deserializing spanned keys

* Store key spans of the table header as well

* Support nested table key spans as well
2019-09-16 16:32:45 -05:00
est31 6bbafa4489 Suppport deserialization of Spanned<> at the top level (#328) 2019-09-05 08:38:54 -05:00
Alex Crichton be450b70d0 Work around a rustfmt bug 2019-08-28 08:02:08 -07:00
Alex Crichton ae63d325d2 wut 2019-08-28 08:01:07 -07:00
Alex Crichton 322412864b More rustfmt 2019-08-28 07:59:44 -07:00
Alex Crichton 5457ef4ee7 Run rustfmt 2019-08-28 07:58:15 -07:00
Eric Huss 994b0e2fcb Allow zero-prefixed float exponents. (#322) 2019-08-23 09:55:15 -07:00
Eric Huss f4dd4a2438 Fix error line/column when using CRLF line endings. 2019-08-13 13:48:54 -07:00
Alex Crichton e0bf3a087a Run `cargo fmt` 2019-08-12 13:50:59 -07:00
Andres Suarez 144e1d0f90 Add line and column to all Errors 2019-07-30 13:35:08 -04:00
Andres Suarez 59aa7214f0 Add tests covering custom deserializers 2019-07-30 13:16:59 -04:00
Andres Suarez 3d08775266 Show "column" in Error messages 2019-07-28 13:41:17 -04:00
Andres Suarez 2a9df8afb9 Fully expand error messages in tests 2019-07-28 12:58:26 -04:00
Alex Crichton e887edc70f
Merge pull request #308 from ehuss/edition-2018
Migrate to 2018 edition
2019-05-09 06:49:11 -07:00
Eric Huss 0fca4dd2d3 cargo fmt 2019-05-08 17:45:39 -07:00
Eric Huss 4ad7eebf9e Remove rustc version checking.
This is no longer necessary, as <1.20 is no longer supported.
2019-05-08 17:39:18 -07:00
Eric Huss 1b01658913 Migrate to 2018 edition. 2019-05-08 12:12:14 -07:00
Alex Crichton 2011390ca8
Merge pull request #298 from ehuss/missing-tests
Add some missing tests, and sort some entries.
2019-04-08 09:09:27 -05:00
Eric Huss c53ed53659 Fix float with invalid suffix. 2019-04-05 13:51:28 -07:00
Eric Huss e121b2ec21 Add some missing tests, and sort some entries. 2019-04-05 13:49:57 -07:00
Erich Gubler d1552ef0ee Fix warnings for deprecated usages of trim_{left,right}_matches. 2019-04-02 09:35:28 -06:00
Eric Huss 8fce90e9cd Fix case sensitivity with T, Z, and E. 2019-02-19 10:59:42 -08:00
Alex Crichton 56f9afb4d2
Merge pull request #278 from Kerollmops/master
Add the preserve_order feature (rebased version)
2019-01-08 15:24:40 -08:00
Alex Crichton 7ee1c1b479 Fix disallowing duplicate table headers
This commit fixes #279 where a case of duplicate table headers slipped
through the cracks. This also adds an option to disable this new
validation to allow Cargo to preserve backwards compatibility.
2019-01-07 09:06:04 -08:00
Clément Renault 0372ba6925
Update the serde test-suite map! macro 2018-12-28 15:39:48 +01:00
Vincent Prouillet 06f916cb60
Add the preserve_order feature 2018-12-28 14:42:55 +01:00
Eric Huss 2dc1913e02 Fix trailing space after date.
The space between date and time was being eagerly skipped when it shouldn't.
2018-11-21 09:35:50 -08:00
Alex Crichton 2a6d85b0dd
Merge pull request #268 from jmhain/allow-ws-after-bs
Allow whitespace after line ending backslash (#162)
2018-10-29 09:47:56 -07:00
hcpl 93c0eaf24e Support tuple Serde types for `Value` 2018-10-28 12:36:40 +02:00
Joey Hain 94c95bd15e Allow whitespace after line ending backslash (#162) 2018-10-27 12:49:17 -07:00
Matti Niemenmaa 2059589f54 Avoid panic on pretty string ending in single quote
Fixes #262.
2018-10-01 11:58:57 +03:00
rhysd 2f372b9f10 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
Alex Crichton 8181a7e645
Merge pull request #255 from kornelski/master
Support deserializing from other integer types
2018-08-06 10:17:30 -05:00
Kornel bc726bb042 Test serde_json interoperability 2018-08-06 15:23:32 +01:00
Eric Huss 223e4b862b Support the new 0.5 syntax in the toml! macro.
- Space in datetime.
- +- inf, nan, 0.0
- Dotted keys.
2018-08-05 14:26:46 -07:00
Eric Huss d6f383d20c Don't allow intermixing inline tables and dotted key tables. 2018-07-27 11:49:30 -07:00
Eric Huss 9796059c58 0.5: Support dotted keys.
cc #224
2018-07-16 09:10:38 -07:00
Eric Huss ec939223aa 0.5: Support hex/oct/bin integers.
cc #224
2018-07-11 09:21:29 -07:00