Make `#[derive(Debug)]` output compatible with ron
This makes ron useful in deserializing output of programs using default Debug trait of Rust.
Do you mean making RON fully compatible with Rust syntax?
I mean making the output of #[derive(Debug)] a subset of ron syntax, so I can use println!("{:?}", value) in addition to normal serializing.
For example, X { a: 1, b: 2 } should be accepted in addition to the current X ( a: 1, b: 2 ). There is no need to drop support for the current form to make it Rust syntax compatible.
This may be possible to do. Ron has syntax for maps (since ron is a superset of JSON), so { a: 1, b: 2 } would be parsed as a map from an enum with variants a and b to ints. I mention this because Ron usually supports omitting struct names. But if we require including the struct name for this syntax, it may be possible.
Do you want to submit a PR for this feature? This syntax addition would likely be feature-gated. Enabling the feature during serialisation would use the new syntax for structs (and struct-like enum variants), and enabling it during deserialisation would allow using the new syntax.
My guess is that it may be as simple as modifying the current deserialize_struct impl (and its variant counterpart). If the struct name was found, it could peek for an opening curly brace and then expect a closing curly brace later, otherwise it would use the current parsing rules. The logic for guessing struct types in deserialize_any would also need to be amended (this case would actually be quite simple to handle).