mrkkrp / parser-combinators

Lightweight package providing commonly useful parser combinators
Other
52 stars 15 forks source link

Add `manyTill_`. #24

Closed kindaro closed 4 years ago

kindaro commented 4 years ago

As discussed in #22.

Tell me if there is anything out of place and I will do my best to fix it. When we are good with this fragment, I will add someTill_.

mrkkrp commented 4 years ago

Don't forget to update CHANGELOG.md when you're down with the functions.

kindaro commented 4 years ago

I have been writing the specification for someTill_ and I could not understand the specification of someTill.

  describe "someTill" $ do
    ...
          p = (,) <$> someTill letterChar (char 'c') <*> many letterChar
    ...         -- `s` is the string we are parsing.
         | head s == 'c' ->
                -- Surely this condition means that `end` is matched immediately.
           prs_ p s `shouldParse` ("c", drop 2 s)
                -- But in that case we should fail, because there were not one
                -- occurrence of the primary parser.
    ...

Can you help me understand this?

mrkkrp commented 4 years ago

@kindaro Character 'c' is also matched by letterChar.

kindaro commented 4 years ago

That is it, kindly take a look.

kindaro commented 4 years ago

@mrkkrp Is something wrong? Not to rush you, but in what time frame can I expect us to proceed with this pull request?

mrkkrp commented 4 years ago

With god's help, in a reasonably narrow time frame, rest assured. The reason for this rather outrageous delay with me processing open source PRs is two-edged, if one could dare to say so. 1) I'm usually quite busy all days except for weekend 2) I'm quite sick at the moment, in a condition which allows me to do very little of meaningful intellectual work other than laying on my spine hoping not to die any time soon.

kindaro commented 4 years ago

Oh, do get better!

mrkkrp commented 4 years ago

I merged this. Going to publish version 1.2.0 on Hackage now. Thanks.

mrkkrp commented 4 years ago

Done.

kindaro commented 4 years ago

@mrkkrp Yo, I forgot to edit the change log!