on 5e6a67f help sign in
42 lines 714 B history raw
1### `++rush`
3Parse or null
5Parse a given with a given rule and produce null if the cord isn't
6entirely parsed.
8Accepts
9-------
11`naf` is an atom.
13`sab` is a rule.
15Produces
16--------
18The value of the parse result, or null.
20Source
21------
23 ++ rush |*({naf/@ sab/rule} (rust (trip naf) sab))
26Examples
27--------
29 ~zod/try=> (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
30 [~ "I was the world in which I walked, and what I saw"]
31 ~zod/try=> (rush 'abc' (just 'a'))
32 ~
33 ~zod/try=> (rush 'abc' (jest 'abc'))
34 [~ 'abc']
35 ~zod/try=> (rush 'abc' (jest 'ac'))
36 ~
37 ~zod/try=> (rush 'abc' (jest 'ab'))
38 ~
42***