diff options
| author | bors <bors@rust-lang.org> | 2013-03-27 21:51:53 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-03-27 21:51:53 -0700 |
| commit | 84ddff3909b5920228642649b7f5cc011c0b900a (patch) | |
| tree | 25cfe9b7ddd20bc08ea56de4fe87dbabf9a885f0 /src/rt/rust_run_program.cpp | |
| parent | 4954d3e50177c46d260a5340ff91bfada8590ef0 (diff) | |
| parent | c317d3f6fa9475e65b6276743c09444441059ca7 (diff) | |
| download | rust-84ddff3909b5920228642649b7f5cc011c0b900a.tar.gz rust-84ddff3909b5920228642649b7f5cc011c0b900a.zip | |
auto merge of #5578 : erickt/rust/incoming, r=jbclements,erickt
Hey folks,
This patch series does some work on the json decoder, specifically with auto decoding of enums. Previously, we would take this code:
```
enum A {
B,
C(~str, uint)
}
```
and would encode a value of this enum to either `["B", []]` or `["C", ["D", 123]]`. I've changed this to `"B"` or `["C", "D", 123]`. This matches the style of the O'Caml json library [json-wheel](http://mjambon.com/json-wheel.html). I've added tests to make sure all this work.
In order to make this change, I added passing a `&[&str]` vec to `Decode::emit_enum_variant` so the json decoder can convert the name of a variant into it's position. I also changed the impl of `Encodable` for `Option<T>` to have the right upper casing.
I also did some work on the parser, which allows for `fn foo<T: ::cmp::Eq>() { ... }` statements (#5572), fixed the pretty printer properly expanding `debug!("...")` expressions, and removed `ast::expr_vstore_fixed`, which doesn't appear to be used anymore.
Diffstat (limited to 'src/rt/rust_run_program.cpp')
0 files changed, 0 insertions, 0 deletions
