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

Incorrect implementation of someSpace for Unlined in Text.Parser.Token. #77

Open
alexandervandenbroucke opened this issue Jan 29, 2019 · 0 comments

Comments

@alexandervandenbroucke
Copy link

The comments on the 'TokenParsing' type class suggest that 'someSpace' should parse at least one space but the instance of 'someSpace' for 'Unlined' also parses the empty string it's definition is:

someSpace = skipMany (satisfy $ \c -> c /= '\n' && isSpace c)

where it should probably be something like

someSpace = spaceNoNewline >> skipMany spaceNoNewline where
spaceNoNewline c = c /= '\n' && isSpace c

minimal example:

Text.Parser.Token Text.Trifecta.Parser Text.Parser.Combinators> parseTest (runUnlined someSpace *> eof ) ""
()

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