Experimental implementation of a new parser for RON using small functional parsers for individual syntax elements over a stateful parser.
This experiment started off as "RON + nom", but is now using its own
parsers & combinators inspired by nom
.
The current ron
parsing suffers from the following problems:
parse.rs
and the deserializer itself
Stateless / functional parsers are
An abstract syntax tree (AST)...
serde::Deserializer
, our_own::Deserializer
, ron-edit
)The old RON deserializer produced errors that were often hard to understand.
ron-reboot
is meant to change that; this is the output of a deserialization
error as of 2021-10-15:
error: invalid type: boolean `true`, expected a string
--> string:3:9
|
3 | y: true,
| ^^^^
|
or with a multi-line expression:
error: invalid type: map, expected a string
--> string:3:9
|
3 | y: (
| ________^
4 | | this: "is",
5 | | not: "the right type",
6 | | ),
| |______^
|
| Goal | Status |
|--------------------------------------------------|----------------------------------------------------|
| Parser generating AST | :hourglassflowingsand: working, 90% complete |
| Parser generating beautiful errors | :hourglassflowingsand: in progress, 70% complete |
| Replace nom combinators | :heavycheckmark: done |
| Spans in AST (locations for error reporting) | :heavycheckmark: implemented |
| Serde Deserializer using AST | :hourglassflowingsand: working, 95% complete |
| Serde Deserializer generating beautiful errors | :heavycheckmark: done |
| ron-edit
(format & comments preserving writer) | :x: to be done |