ron-rs / ron

Rusty Object Notation
https://docs.rs/ron
Apache License 2.0
3.31k stars 122 forks source link

CLI tool to check syntax #538

Closed colemickens closed 5 months ago

colemickens commented 5 months ago

Please document a tool that can be used to check Ron syntax. As more apps are adopting ron, it would be really great to not need (1) an entire rust sample app or (2) a full blown IDE with extension, to do basic syntax checking.

colemickens commented 5 months ago

maybe this doesn't even make sense, if it needs a rust struct to know what the right format is.

juntyr commented 5 months ago

Just to clarify, do you mean a tool that can check whether a document is syntactically correct RON (adheres to the grammar) but not whether it is a valid document for a particular data structure?

Inside this repo, the closest you can get is to deserialise a https://docs.rs/serde/latest/serde/de/struct.IgnoredAny.html and to report any errors that show up.

I'm sure there are also other tools as well that implement the RON grammar to perform some cheaper-than-full-deserialisation checks, perhaps someone else has some other recommendations for you.

colemickens commented 5 months ago

Thanks, I think that answers my question pretty completely. No need to keep this open.