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

chompUntil does not consume the last string #20

Open
jinjor opened this issue Nov 2, 2018 · 0 comments · May be fixed by #21 or #54
Open

chompUntil does not consume the last string #20

jinjor opened this issue Nov 2, 2018 · 0 comments · May be fixed by #21 or #54

Comments

@jinjor
Copy link
Contributor

jinjor commented Nov 2, 2018

chompUntil and chompUntilEndOr consume only position but not the last string. chompIf and chompWhile work as expected.

SSCCE: https://ellie-app.com/3MJnNtV3KDFa1

main : Html msg
main =
    text (Debug.toString (Parser.run chomper "foobar"))


chomper : Parser (String, ( Int, Int ))
chomper =
    succeed Tuple.pair
        |= getChompedString (chompUntil "bar")
        |= getPosition

exceted:

Ok ("foobar",(1,7))

actual:

Ok ("foo",(1,7))
  • elm/parser: 1.1.0

Related: #2

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