File tree 6 files changed +629
-17
lines changed 6 files changed +629
-17
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ Breaking changes:
46
46
New features:
47
47
48
48
- Add the ` anyTill ` primitive ` String ` combinator. (#186 by @jamesdbrock )
49
+ - Add the ` Parsing.String.Replace ` module, copied from
50
+ https://github.com/jamesdbrock/purescript-parsing-replace (#188 by @jamesdbrock )
49
51
50
52
Bugfixes:
51
53
Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ in conf //
11
11
{ sources = [ " src/**/*.purs" , " test/**/*.purs" , " bench/**/*.purs" ]
12
12
, dependencies = conf. dependencies #
13
13
[ " assert"
14
+ , " bifunctors"
14
15
, " console"
15
16
, " enums"
16
17
, " effect"
17
18
, " psci-support"
18
19
, " minibench"
20
+ , " node-process"
19
21
, " exceptions"
20
22
, " string-parsers"
21
23
, " partial"
Original file line number Diff line number Diff line change 14
14
, " lists"
15
15
, " maybe"
16
16
, " newtype"
17
+ , " nonempty"
17
18
, " numbers"
18
19
, " partial"
19
20
, " prelude"
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ anyChar :: forall m. ParserT String m Char
98
98
anyChar = satisfy (const true )
99
99
100
100
-- | Match any Unicode character.
101
- -- | Always succeeds.
101
+ -- | Always succeeds when any input remains .
102
102
anyCodePoint :: forall m . ParserT String m CodePoint
103
103
anyCodePoint = satisfyCodePoint (const true )
104
104
@@ -290,9 +290,19 @@ consumeWith f = ParserT
290
290
-- | Will fail if no section of the input is parseable. To backtrack the input
291
291
-- | stream on failure, combine with `tryRethrow`.
292
292
-- |
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
+ -- |
293
299
-- | This combinator is equivalent to `manyTill_ anyCodePoint`, but it will be
294
300
-- | faster because it returns a slice of the input `String` for the
295
301
-- | 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²)*.
296
306
anyTill
297
307
:: forall m a
298
308
. Monad m
You can’t perform that action at this time.
0 commit comments