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

Adopt some staff from elm parser? #63

Open
safareli opened this issue Jun 25, 2017 · 4 comments
Open

Adopt some staff from elm parser? #63

safareli opened this issue Jun 25, 2017 · 4 comments

Comments

@safareli
Copy link
Contributor

This is interesting alternative to try in ps-parser
https://github.com/elm-tools/parser/blob/2.0.1/src/Parser.elm#L510-L549

Also having problem as sum type is kinda nit
http://package.elm-lang.org/packages/elm-tools/parser/2.0.1/Parser#Problem

@paf31
Copy link
Contributor

paf31 commented Jun 25, 2017

I'd rather make a type argument for the error type. We've tried the sum type approach in foreign, and it handles some but not all errors.

Looks like that combinator could be implemented with try fairly easily. We could add something like it.

@jamesdbrock
Copy link
Member

@jamesdbrock
Copy link
Member

Hm I think we have a partial solution to this with https://pursuit.purescript.org/packages/purescript-parsing/10.0.0/docs/Parsing.Combinators#v:advance

which was discussed in #120

@jamesdbrock
Copy link
Member

It looks like the delayedCommit function has been replaced by backtrackable?

elm/parser#6 (comment)

https://package.elm-lang.org/packages/elm/parser/latest/Parser#backtrackable

Read this document to learn how oneOf, backtrackable, and commit work and interact with each other. It is subtle and important!

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

No branches or pull requests

3 participants