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

Introduce a safe and unsafe mode #7

Open
raganhan opened this issue Oct 19, 2018 · 0 comments
Open

Introduce a safe and unsafe mode #7

raganhan opened this issue Oct 19, 2018 · 0 comments

Comments

@raganhan
Copy link
Contributor

Some callback interactions with the reader today are potentially dangerous, for example:

  • calling reader.next() without seeking back on the input stream
  • stepping in and stepping out when you have nested search paths, e.g. (foo) and (foo bar), without seeking back on the input stream

Seeking back is not trivial and in some cases impossible. Those operations won't cause the path extractor to fail but to misbehave surprising users

To avoid this we can introduce two modes:

  • unsafe: todays implementation where the callback is simply stated and left to the user to respect it
  • safe: where we provide a decorated reader that blocks potentially harmful operations. This decorator should be intelligent enough to only forbid stepping into containers when there are nested search paths
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