We are using the YAML parser for development-time support, including code completion, and this requires the parser to be able to recover well in the face of errors in order to provide the best UX.
I believe that naively adding recovery would be a breaking change because the parser would begin to return guesses for what it thinks the user intended to type in situations where it previously would have returned null. I believe, however, that we can make it a non-breaking change by putting recovery behind a flag that is optionally passed to the loadYaml* functions (something like bool recover = false).
Extending the API in this way would also allow us to incrementally implement recovery based on which failure cases occur most often.
Does that seem like a reasonable approach?
We are using the YAML parser for development-time support, including code completion, and this requires the parser to be able to recover well in the face of errors in order to provide the best UX.
I believe that naively adding recovery would be a breaking change because the parser would begin to return guesses for what it thinks the user intended to type in situations where it previously would have returned
null. I believe, however, that we can make it a non-breaking change by putting recovery behind a flag that is optionally passed to theloadYaml*functions (something likebool recover = false).Extending the API in this way would also allow us to incrementally implement recovery based on which failure cases occur most often.
Does that seem like a reasonable approach?