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

Fix issue with inability to parse mandatory types #222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fredefox
Copy link

@fredefox fredefox commented Aug 7, 2019

Prior to this commit:

λ parseWith (pure mempty) type_ "[B!]!"
Done "!" (TypeList ...)

With this commit we now have:

λ parseWith (pure mempty) type_ "[B!]!"
Done "" (TypeNonNull ...)

The important thing to note here is that previous "[B!]!" was parsed
as a list type (not a non-null type), but all the input was not
consumed as expected. This means that whatever parser comes after
would start by looking at the exclamation point, which belongs to the
type.

This aims to close #221

Prior to this commit:

    λ parseWith (pure mempty) type_ "[B!]!"
    Done "!" (TypeList ...)

With this commit we now have:

    λ parseWith (pure mempty) type_ "[B!]!"
    Done "" (TypeNonNull ...)

The important thing to note here is that previous "[B!]!" was parsed
as a list type (not a non-null type), but all the input was not
consumed as expected.  This means that whatever parser comes after
would start by looking at the exclamation point, which belongs to the
type.
@fredefox
Copy link
Author

fredefox commented Aug 7, 2019

parseWith (pure mempty) -- BTW -- was a trick I came up with to inspect how much input attoparsec consumes. See http://hackage.haskell.org/package/attoparsec-0.13.2.2/docs/Data-Attoparsec-Text.html#v:parseWith

Enabled extensions: DerivingStrategies and StandaloneDeriving
@teh
Copy link
Collaborator

teh commented Aug 12, 2019

Thanks! Can you change this to the value 1364? I believe that will fix the test.

@fredefox
Copy link
Author

Thanks! Can you change this to the value 1364? I believe that will fix the test.

Ah cool! Thanks for providing the fix, I had just glossed over it. I will update this PR later.

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.

Issue with parsing non-nullable types
2 participants