Skip to content

Commit e85fe6e

Browse files
committed
Module Parsing.String.Replace
Copied from https://github.com/jamesdbrock/purescript-parsing-replace
1 parent ed85e62 commit e85fe6e

File tree

2 files changed

+452
-0
lines changed

2 files changed

+452
-0
lines changed

src/Parsing/String.purs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,19 @@ consumeWith f = ParserT
290290
-- | Will fail if no section of the input is parseable. To backtrack the input
291291
-- | stream on failure, combine with `tryRethrow`.
292292
-- |
293+
-- | This combinator works like
294+
-- | [Data.String.takeWhile](https://pursuit.purescript.org/packages/purescript-strings/docs/Data.String#v:takeWhile)
295+
-- | or
296+
-- | [Data.String.Regex.search](https://pursuit.purescript.org/packages/purescript-strings/docs/Data.String.Regex#v:search)
297+
-- | and it allows using a parser for the pattern search.
298+
-- |
293299
-- | This combinator is equivalent to `manyTill_ anyCodePoint`, but it will be
294300
-- | faster because it returns a slice of the input `String` for the
295301
-- | section preceding the parse instead of a `List CodePoint`.
302+
-- |
303+
-- | Be careful not to look too far
304+
-- | ahead; if the phrase parser looks to the end of the input then `anyTill`
305+
-- | could be *O(n²)*.
296306
anyTill
297307
:: forall m a
298308
. Monad m

0 commit comments

Comments
 (0)