on ecfde25 help sign in
40 lines 785 B history raw
1### `++full`
3Parse to end
5Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
6when the of `tub` is fully consumed using `sef`.
8Accepts
9-------
11`sef` is a `++rule`.
13Produces
14--------
16A `++rule`.
18Source
19------
21 ++ full :: parse to end
22 |* sef=_rule
23 |= tub=nail
24 =+ vex=(sef tub)
25 ?~(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
26 ::
28Examples
29--------
31 ~zod/try=> ((full (just 'a')) [[1 1] "ab"])
32 [p=[p=1 q=2] q=~]
33 ~zod/try=> ((full (jest 'ab')) [[1 1] "ab"])
34 [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
35 ~zod/try=> ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
36 [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
40***