Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failability of parsing code #73

Open
Licenser opened this issue Oct 28, 2023 · 2 comments
Open

failability of parsing code #73

Licenser opened this issue Oct 28, 2023 · 2 comments

Comments

@Licenser
Copy link
Member

          although I really do think there should be a discussion about the safety of the parsing code, why is parse fallible, and why we parse the array, without having the values of the array in the first place

Originally posted by @NightMare-Vortex in #54 (comment)

@Licenser
Copy link
Member Author

I agree, definetly worth considering and revisiting! I pulled this in it's own issue so it's nut buried in a completed PR :)

@Licenser
Copy link
Member Author

a few startingpoints:

  1. the tape is (assuming no bugs) guaranteed to be valid JSON, all validation from formating (numbers, strings etc) and structure (correct k/v of objects, correct nesting etc) are checked in the second stage of parsing

  2. for derives we need fallibility as we can have a valid json that does not match the expected structure that the derive demands

  3. for DOM like structures (owned::Value, borrowed::Value that cover the entire JSON value space) we can expect all translation from tape -> dom to be correct

  4. for DOM like structures that may not cover the entire value space, there is a chance of failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant