on 492ae2f help sign in
42 lines 743 B history raw
1### `++easy`
3Always parse
5Parser generator. Produces a parser that succeeds with given noun `huf`
6without consuming any text.
8Accepts
9-------
11`huf` is a noun.
13Produces
14--------
16A `++rule`.
18Source
19------
21 ++ easy :: always parse
22 ~/ %easy
23 |* huf=*
24 ~/ %fun
25 |= tub=nail
26 ^- (like ,_huf)
27 [p=p.tub q=[~ u=[p=huf q=tub]]]
28 ::
30Examples
31--------
33 ~zod/try=> ((easy %foo) [[1 1] "abc"])
34 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
35 ~zod/try=> ((easy %foo) [[1 1] "bc"])
36 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
37 ~zod/try=> ((easy 'a') [[1 1] "bc"])
38 [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
42***