on beeb398 help sign in
37 lines 621 B history raw
1### `++funk`
3Add to tape
5Parser modifier: prepend text to `++tape` before applying parser.
7Accepts
8-------
10`pre` is a `++tape`
12`sef` is a `++rule`
14Produces
15--------
17A `++rule`.
19Source
20------
22 ++ funk :: add to tape first
23 |* {pre/tape sef/rule}
24 |= tub/nail
25 (sef p.tub (weld pre q.tub))
27Examples
28--------
30 ~zod/try=> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
31 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
32 ~zod/try=> ((funk "parse" (just 'a')) [[1 4] " me"])
33 [p=[p=1 q=4] q=~]
37***