Skip to content

Conversation

randomeizer
Copy link
Contributor

Relates to Discussion #106.

Copy link
Member

@stephencelis stephencelis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randomeizer Thanks for taking the time to PR! We're actually in the middle of changing the backtracking behavior on main, and those changes will be taken into this branch soon. We're basically removing backtracking from all parsers with the exception of Peek and Not, and adding backtracking to each step of OneOf instead. This should make it much simpler to create parsers since you don't have to actively worry about backtracking work. It'll all be taken care of for you.

I'm going to merge this but just wanted to let you know it will be changing even more soon 😄

@stephencelis stephencelis merged commit 061c172 into pointfreeco:parser-builder-throws-2 Feb 8, 2022
stephencelis added a commit that referenced this pull request Feb 14, 2022
* Throwing parsers

* wip

* wip

* wip

* term

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* don't backtrack

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* rank one of errors

* rank errors by most processed

* nested

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update benches

* wip

* idiomatic

* wip

* wip

* wip

* truncate

* wip

* wip

* wip

* wip

* clean up

* wip

* wip

* wip

* wip

* wip

* wip

* Some docs and update tests to use public conversion

* removed testable imports

* lots of docs

* wip

* many terminator failure

* wip

* add loop error

* Added reversion to original if any parsers in `Zip` variations throw an error (#107)

* Added reversion to original if any parsers in `Zip` variations throw an error.

* Updated ParserBuilderTests to check correct consumption of the input

* wip

* wip

* wip

* wip

* wip

* wip

* Bump package tools version

* wip

* docs

* wip

* wip

* wip

* Update Parser.swift

* wip

* wip

* wip

* NewOutput

* readme

* wip

* wip

* wip

* wip

* wip

Co-authored-by: Brandon Williams <[email protected]>
Co-authored-by: David Peterson <[email protected]>
mbrandonw added a commit that referenced this pull request Apr 11, 2022
* wip

* don't backtrack

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* rank one of errors

* rank errors by most processed

* nested

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* from

* wip

* wip

* wip

* Update benches

* wip

* idiomatic

* wip

* wip

* wip

* truncate

* wip

* wip

* wip

* wip

* clean up

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Some docs and update tests to use public conversion

* removed testable imports

* lots of docs

* wip

* wip

* wip

* many terminator failure

* wip

* add loop error

* force MapConversion to work only on printers

* bye bye exactly

* wip

* wip

* Added reversion to original if any parsers in `Zip` variations throw an error (#107)

* Added reversion to original if any parsers in `Zip` variations throw an error.

* Updated ParserBuilderTests to check correct consumption of the input

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* Bump package tools version

* wip

* fix

* backtrack printing

* wip

* wip

* wip

* wip

* wip

* New VoidMap parser and updated race parser.

* wip

* pullback

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* docs

* wip

* wip

* wip

* wip

* wip

* wip

* wiop

* print tests for PrefixUpTo/Through

* Printer prepending instead of appending (#145)

* Pointing `swift-custom-dump` to the "main" branch, since `0.4.0` hasn't been released publicly yet.

* Switched printing to `prepend` rather than `append`

Consequentially, all parsers that compose multiple parsers work backwards through provided parsers, and the `input` is built up from the back to the front.

This allows print to check that the output is correct for cases like `Rest`, `Prefix`, `Not`, and `Peek`.

* Added `Many` tests, fixed terminator bug

* Whitespace cleanup

* Fixed typo in test name.

* Updated `End` to check input when printing.

Added related tests.

* Switched `Literal` printing to append rather than insert

They now append into a copy of themselves, then append the `input`.

* Updated `PrependableCollection` to use `append` internally

* Improved error output for OneOfMany

* Adds backtracking to `Optionally`

* Added unit test to check backtracking

* Updated the `testBacktracking` case

Makes it clearer under what circumstances it will fail without backtracking.

* Added backtracking to Optionally

Also updated documentation about backtracking in general.

* Removed incorrectly merged test case.

* Added `Expect`

Which can be both parsed and printed.

* Made the unexpected `Peek` success a passing test

Added notes about why it doesn't throw an error.

* wip

* wip

* wip

* wip

* wip

* Update README.md

Co-authored-by: Brandon Williams <[email protected]>

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fixes

Co-authored-by: Stephen Celis <[email protected]>
Co-authored-by: Stephen Celis <[email protected]>
Co-authored-by: Brandon Williams <[email protected]>

* wip

* wip

* Updates Optionally to throw any internal `wrapped.print(...)` error (#167)

* Pointing `swift-custom-dump` to the "main" branch, since `0.4.0` hasn't been released publicly yet.

* Made Optionally fail if the wrapped parser fails

Added test cases for printing, and example of failing an invalid print.

* Remove `.map` overload on Always

* wip

* wip

* Make Rest.print fail on empty output.

* roundtripping doc

* wip

* struct conversion docs

* rename .struct to .memberwise

* fixes

* lots of docs

* docs

* wip

* wip

* Revert "wip"

This reverts commit cde658d.

* Printer -> ParserPrinter

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* basic errors

* wip

* wip

* fix

* Simplify `Consumed`

* wip

* wip

* wip

* decumulator

* wip

* wip

* wip

* wip

* wip

* wip

* clean up

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix docc warnings

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

Co-authored-by: Stephen Celis <[email protected]>
Co-authored-by: David Peterson <[email protected]>
Co-authored-by: Stephen Celis <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants