Commit graph

34 commits

Author SHA1 Message Date
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
Eric Huss fad5f4690e Don't allow intermixing inline tables and dotted key tables. 2018-07-27 11:49:30 -07:00
Eric Huss e0a820be2f Support older rustc. 2018-07-16 09:10:38 -07:00
Eric Huss 6d76b19b58 0.5: Support dotted keys.
cc #224
2018-07-16 09:10:38 -07:00
Eric Huss c8919e8ed1 0.5: Support hex/oct/bin integers.
cc #224
2018-07-11 09:21:29 -07:00
Alex Crichton 625d2a18bb Merge pull request #251 from ehuss/datetime-space
0.5: Support space separator in datetime.
2018-07-11 09:05:26 -05:00
Eric Huss 16d8b14fcf 0.5: Support floats nan, inf, and +/-0.0.
cc #224
2018-07-11 00:50:04 -07:00
Eric Huss 5204d8b50a 0.5: Support space separate in datetime.
cc #224
2018-07-10 17:14:16 -07:00
John-John Tedro 407845d620 Fix incorrectly reported spans for Datetime 2018-05-07 05:36:41 +02:00
John-John Tedro 8a9ae07de5 Use BorrowedStrDeserializer instead of generated key deserializers 2018-05-07 04:57:16 +02:00
John-John Tedro 09c8957ae7 Adjust spans for more complex types 2018-05-07 04:28:00 +02:00
John-John Tedro 6b919f8833 Use custom struct/field naming to deserialize spans 2018-05-07 04:28:00 +02:00
David Tolnay 6db43965f9 Proof of concept: reporting span information to a Spanned<T> type 2018-05-06 11:06:00 +02:00
John-John Tedro 6d7c89169b Make Tokenizer emit spans 2018-05-01 13:53:52 +02:00
Alex Crichton 66bbdb36a6 One more case of handling newtype structs 2017-07-06 11:43:36 -07:00
Alex Crichton 7a8c535c5a Support deserializing newtypes
Closes #196
2017-07-06 07:34:45 -07:00
Alan Du 90040b34b6 Error when parsing numbers outside of f64's range 2017-05-31 00:30:55 +01:00
Raphaël Huchet 9158482ed9 Update de.rs 2017-05-10 17:17:58 +02:00
Raphaël Huchet 0d3b3e3a36 add example for from_str 2017-05-10 16:49:35 +02:00
Oliver Schneider 80ed3e7a7b Document that line/col indices are 0 based 2017-05-09 17:08:26 +02:00
Oliver Schneider 26d39b3a15 Allow extracting the location of the error 2017-05-09 11:22:18 +02:00
Vincent Prouillet a6f22570ae Address comment and make test pass 2017-04-28 13:00:37 +09:00
Vincent Prouillet c675b4f259 Deserialize enum in Value 2017-04-25 13:57:35 +09:00
Vincent Prouillet 36f33ff3b3 Remove everything other than enum variant code 2017-04-25 12:06:04 +09:00
Vincent Prouillet 7cb357c168 Allow to deserialize/serialize into enums
Close #164
2017-04-24 22:13:38 +09:00
Alex Crichton dc5ff1ef90 Support serde 1.0.0 2017-04-20 10:16:00 -07:00
Daniel Lockyer cecb0b58a7 Stop taking references when not needed 2017-04-12 09:29:00 +01:00
Daniel Lockyer 3034a7cf52 Simplify if-statements 2017-04-12 09:28:56 +01:00
Daniel Lockyer 50714395c2 Switch from comparison to is_empty() 2017-04-12 09:24:16 +01:00
Daniel Lockyer de940a3373 Remove unneeded return statements 2017-04-12 09:24:16 +01:00
Matthias Endler 6f2f475b88 Replace unwrap with expect in public methods 2017-04-05 21:56:18 +02:00
Alex Crichton 5152f3aca0 Fix backcompat with array definitions 2017-03-31 18:45:00 -07:00
Alex Crichton d02c02d995 Implement Deserializer::set_require_newline_after_table 2017-02-08 21:36:38 -08:00
Alex Crichton e256931e9b Rewrite crate with serde support from ground up
This commit completely rewrites this crate from the ground up,
supporting serde at the lowest levels as I believe serde support was
intended to do. This is a major change from the previous versions of
this crate, with a summary of changes being:

* Serialization directly to TOML is now supported without going through
  a `Value` first.

* Deserialization directly from TOML is now supported without going
  through a `Value`. Note that due to the TOML format some values still
  are buffered in intermediate memory, but overall this should be at a
  minimum now.

* The API of `Value` was overhauled to match the API of
  `serde_json::Value`. The changes here were to:

  * Add `is_*` accessors
  * Add `get` and `get_mut` for one-field lookups.
  * Implement panicking lookups through `Index`

  The old `index` methods are now gone in favor of `get` and `Index`
  implementations.

* A `Datetime` type has been added to represent a TOML datetime in a
  first-class fashion. Currently this type provides no accessors other
  than a `Display` implementation, but the idea is that this will grow
  support over time for decomposing the date.

* Support for the `rustc-serialize` crate has been dropped, that'll stay
  on the 0.2 and 0.1 release trains.

* This crate no longer supports the detection of unused fields, for that though
  you can use the `serde_ignored` crate on crates.io
2017-02-08 21:21:18 -08:00