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

Input trait #45

Merged
merged 63 commits into from Aug 31, 2016

Conversation

Projects
None yet
2 participants
@m4rw3r
Owner

m4rw3r commented Mar 18, 2016

See #44

  • Investigate removal of State::Incomplete

    Simplifies all combinators which otherwise had to special-case the incomplete states. Does not seem to actually improve performance in any way despite decreasing the number of possible branches, guess that goes to show how good branch-prediction is in a modern CPU.

    Conclusion: removed State::Incomplete.

  • Implement Input for &str

  • Implement Input for an Iterator wrapper

    Moved to separate PR #49

  • Implement Input for Tendril

  • Replace the inner State type with Result since it is just a success/fail state and makes for easier conversions and simpler code in general.

  • Implement a numbering wrapper for any Input.

  • Move input::InputBuf to buffer module and replace the mode property with a boolean flag.

  • Update tests to accommodate for Incomplete removal and restructuring of the Input.

    It is probably suitable to investigate if Quickcheck can be used here (#33)

  • Rework buffer module

    Make sure lifetimes are removed (now part of Input implementation), simplify.

  • Update doctests

  • Support for optimized skip_while in Input

@m4rw3r

This comment has been minimized.

Show comment
Hide comment
@m4rw3r

m4rw3r Mar 18, 2016

Owner

This will probably need a rework of the buffer module to better fit the new Input traits.

Owner

m4rw3r commented Mar 18, 2016

This will probably need a rework of the buffer module to better fit the new Input traits.

@m4rw3r

This comment has been minimized.

Show comment
Hide comment
@m4rw3r

m4rw3r Mar 19, 2016

Owner

Would be interesting to investigate if the State::Incomplete could be removed in favor of something like attoparsec's continuations (ie. ask the type implementing Input for more data, fail or succeed if no more data could be provided depending on the parser).

Owner

m4rw3r commented Mar 19, 2016

Would be interesting to investigate if the State::Incomplete could be removed in favor of something like attoparsec's continuations (ie. ask the type implementing Input for more data, fail or succeed if no more data could be provided depending on the parser).

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Mar 30, 2016

Coverage Status

Coverage decreased (-0.9%) to 95.508% when pulling 359e909 on feature/input_trait into 456c5d4 on master.

Coverage Status

Coverage decreased (-0.9%) to 95.508% when pulling 359e909 on feature/input_trait into 456c5d4 on master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Mar 31, 2016

Coverage Status

Coverage decreased (-0.7%) to 95.686% when pulling 39f5838 on feature/input_trait into 456c5d4 on master.

Coverage Status

Coverage decreased (-0.7%) to 95.686% when pulling 39f5838 on feature/input_trait into 456c5d4 on master.

@m4rw3r m4rw3r referenced this pull request May 17, 2016

Closed

Make `Input` a trait #44

m4rw3r added some commits Mar 17, 2016

Input trait: Made it possible to be even more generic over the input,…
… the buffer-return does not need to be tied directly to the input itself
Updated combinators
* State::Incomplete now also carries the input state, needed to be able
  to backtrack on incomplete
Macros: Reversed use of Universal Function Call syntax for Input
This caused issues due to `Input` inside of the function body not
being considered the same as the actual type supplied to the function.

@m4rw3r m4rw3r merged commit c63b5b4 into master Aug 31, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@m4rw3r m4rw3r deleted the feature/input_trait branch Sep 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment