File tree 9 files changed +733
-19
lines changed
9 files changed +733
-19
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 @@ -130,7 +130,6 @@ There are lots of other great monadic parsing tutorials on the internet.
130
130
## Related Packages
131
131
132
132
- [ __ ` parsing-dataview ` __ ] ( https://pursuit.purescript.org/packages/purescript-parsing-dataview ) primitive parsers for binary parsing of ` ArrayBuffer ` .
133
- - [ __ ` parsing-replace ` __ ] ( https://pursuit.purescript.org/packages/purescript-parsing-replace ) for finding text patterns, and also replacing or splitting on the found patterns.
134
133
- [ __ ` datetime-parsing ` __ ] ( https://pursuit.purescript.org/packages/purescript-datetime-parsing ) for parsing dates and times.
135
134
136
135
## Documentation
Original file line number Diff line number Diff line change 24
24
"purescript-maybe" : " master" ,
25
25
"purescript-newtype" : " master" ,
26
26
"purescript-numbers" : " master" ,
27
+ "purescript-nullable" : " main" ,
27
28
"purescript-prelude" : " master" ,
28
29
"purescript-record" : " master" ,
29
30
"purescript-strings" : " master" ,
35
36
"purescript-unsafe-coerce" : " master"
36
37
},
37
38
"devDependencies" : {
38
- "purescript-assert" : " master"
39
+ "purescript-assert" : " master" ,
40
+ "purescript-effect" : " master" ,
41
+ "purescript-node-process" : " master"
39
42
}
40
43
}
Original file line number Diff line number Diff line change 1
1
let upstream =
2
2
https:// raw. githubusercontent. com/ purescript/ package- sets/ prepare- 0.15 / src/ packages. dhall
3
- sha256: b1c6d06132b7cbf1e93b1e5343044fba1604b50bfbe02d8f80a3002e71569c59
4
3
5
4
in upstream
Original file line number Diff line number Diff line change @@ -11,11 +11,14 @@ 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"
21
+ , " nonempty"
19
22
, " exceptions"
20
23
, " string-parsers"
21
24
, " partial"
Original file line number Diff line number Diff line change 4
4
, dependencies =
5
5
[ " arrays"
6
6
, " control"
7
+ , " effect"
7
8
, " either"
8
9
, " enums"
9
10
, " foldable-traversable"
15
16
, " maybe"
16
17
, " newtype"
17
18
, " numbers"
19
+ , " nullable"
18
20
, " partial"
19
21
, " prelude"
22
+ , " st"
20
23
, " strings"
21
24
, " tailrec"
22
25
, " transformers"
23
26
, " tuples"
24
27
, " unfoldable"
25
28
, " unicode"
29
+ , " unsafe-coerce"
26
30
]
27
31
, packages = ./ packages. dhall
28
32
, sources = [ " src/**/*.purs" ]
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