Commit graph

156 commits

Author SHA1 Message Date
Bourgond Aries 644dc88c04 Add a bunch of negative and positive tests 2016-03-28 06:35:39 +02:00
Bourgond Aries 33c49d0357 Leverage fn array_index to fn integer 2016-03-28 06:24:25 +02:00
Bourgond Aries 568dd2ef4b Fix the indentation to be consistent with the repository 2016-03-27 21:19:03 +02:00
Bourgond Aries 442f663c2d Add advanced lookup for table names 2016-03-27 20:55:49 +02:00
Bourgond Aries 770052a9a7 Add a test for lookup_mut_advanced 2016-03-27 20:50:25 +02:00
Bourgond Aries 0e3e0654ba Implement advanced key lookup for lookup_mut 2016-03-27 20:48:23 +02:00
Bourgond Aries 3517215eab Implement a more advanced algorithm for lookup
The new algorithm allows the explicit usage of "" and '' to denote key
names. This is useful for accessing tables or keys that are named in a
non-conventional manner.
2016-03-27 20:46:19 +02:00
Bourgond Aries b171205c57 Add a test to see if the table's contents have changed 2016-03-25 17:43:32 +01:00
Bourgond Aries 32969ca891 Implement the non-recursive lookup_mut
Also include some tests simply by copying and modifying
the other tests for lookup.
2016-03-25 17:33:46 +01:00
Bourgond Aries 9b1dc843fc Add lookup_mut method for mutable access
Mutable access may sometimes be desired in order to change values
in the toml table. This can be used for dynamic configurations which
will be easy to modify and store.

lookup_mut requires a recursive method due to the borrow checker
not allowing to have more than one mutable reference in the same
scope.
2016-03-24 14:18:00 +01:00
Alex Crichton 511c235d7d Fix last tests 2016-03-11 09:20:32 -08:00
Alex Crichton 3345fea319 Fix an error message test, simlify some serde code 2016-03-11 01:32:16 -08:00
Alex Crichton d02e622330 WIP 2016-03-07 23:48:01 -08:00
Alex Crichton 6b0a1362a1 Support literal strings in table names
Closes #85
2016-01-24 10:50:39 -08:00
Corey Farwell 7be39d725d Address issues found by rust-clippy 2016-01-21 08:38:09 -05:00
Jake Goulding 67107034fc Minor documentation grammar fix 2016-01-01 17:57:01 -05:00
Alex Crichton 39d77b6d79 When decoding maps, leave fields that weren't processed
Fixes an XXX
2015-12-18 16:29:07 -08:00
Cameron Silvestrini caa4615536 Fixed bug: floats always end up in Decoder.toml, even when they have
been successfully decoded.
2015-12-15 22:43:24 +11:00
osboxes.org dea8646b8b Allow BOM (Byte order mark) in toml 2015-10-07 11:35:49 +02:00
Guillaume Gomez db75e532e5 Add Clone derive on ParserError 2015-09-30 00:00:17 +02:00
Kerhong 547e202c15 Implement Value::lookup for empty path to return self 2015-09-25 19:26:47 +03:00
mseri dc0aa5f6c4 Fixed typo 2015-08-29 12:47:21 +01:00
Alex Gulyás 64ae43a386 Fix the arithmetic overflow in Parser::to_linecol
This also changes the calculated line and column numbers. Without this
patch, if an error occurs at the end of a line, the returned line and
column numbers will point at the start of the next line.

After this patch, the line and column numbers will correctly point at
the end of the line where the actual parse error happened.
2015-08-14 14:54:32 +02:00
Alex Crichton 7ec4821bd7 Touch up some style in the decoder 2015-08-13 09:47:40 -07:00
Erick Tryzelaar 85cd6f3e6e Rewrite the MapVisitor to add errors for a specific field 2015-08-13 08:25:56 -07:00
Erick Tryzelaar 8c33064c2c Override the numeric hints to not deserialize ints into floats, and vice versa 2015-08-13 08:25:56 -07:00
Erick Tryzelaar e5efc8801d Add a Deserialize::visit_enum that tries to deserialize into each variant
This could be more efficiently done if serde communicated the
number of arguments in each variant in this function.
2015-08-13 08:25:56 -07:00
Erick Tryzelaar b7b31bf9da Implement Serialize::visit_newtype_{struct,variant}
These functions allow a serializer to not wrap a newtyped value
inside of a tuple or struct.
2015-08-13 07:42:06 -07:00
Erick Tryzelaar bbc167cde9 Get serde feature compiling again 2015-08-12 23:01:49 -07:00
Erick Tryzelaar 4e0172a9a5 Merge remote-tracking branch 'remotes/origin/master' into serde 2015-08-12 22:15:58 -07:00
Alex Crichton b70f6e53b2 Don't need to qualify String 2015-08-11 09:18:52 -07:00
Ben Navetta 8a2282fecd it helps to actually build with serde enabled 2015-08-06 23:33:39 -04:00
Ben Navetta 00337d088e implement serde::Deserialize for Value 2015-08-06 23:30:08 -04:00
Alex Crichton 89332806c5 Improve the error message in failing enums 2015-06-23 17:45:48 -07:00
Alex Crichton 27a70d4024 Name the fields of the custom table AST 2015-06-08 00:04:30 -07:00
Alex Crichton 00baf76107 Add a few more tests for redefining tables 2015-06-07 23:58:45 -07:00
Alex Crichton 88461157f2 Clean up more style 2015-06-07 23:57:50 -07:00
Alex Crichton 68924534e2 Use deref coercions 2015-06-07 23:48:32 -07:00
Alex Crichton 6580b77a20 Re-structure control flow a bit + modernization 2015-06-07 23:47:22 -07:00
Andrzej Janik 8487b63c97 Rework fix for table redefinition to avoid breaking AST-compatiblity 2015-06-06 18:11:48 +02:00
Andrzej Janik 2fcd829b1d Disallow table redefinitions 2015-06-04 20:23:46 +02:00
Alex Crichton 94023b1d89 Fix serde-only compilation 2015-04-21 12:00:05 -07:00
Alex Crichton 3301c39630 Tweak some style 2015-04-21 09:16:06 -07:00
Oliver Schneider 6e2f2c39e4 most tests work now 2015-04-20 15:11:34 +02:00
Oliver Schneider ac86f4c941 updated to master 2015-04-20 12:29:58 +02:00
Alex Crichton 41563ee01b wip 2015-04-02 17:12:37 -07:00
Alex Crichton 2d49247b92 Modularize rustc-serialize support
* Add rustc-serialize as a default feature
* Make room for for serde support
2015-04-02 17:07:37 -07:00
Alex Crichton cd33b87bf9 Bump to 0.1.20 2015-04-01 09:56:05 -07:00
Alex Crichton c8a5ca4ece Bump to 0.1.19 2015-03-25 10:11:05 -07:00
Alex Crichton 2c5aa07722 Implement Encodable for Value
We can't generically decode into one, but we can generically encode one!

Closes #58
2015-03-20 10:53:36 -07:00