on bfaa358 help sign in
50 lines 791 B history raw
1### `++just`
3Match a char
5Match and consume a single character.
7Accepts
8-------
10`daf` is a `++char`
12Produces
13--------
15A `++rule`.
17Source
18------
20 ++ just :: XX redundant, jest
21 ~/ %just :: match a char
22 |= daf/char
23 ~/ %fun
24 |= tub/nail
25 ^- (like char)
26 ?~ q.tub
27 (fail tub)
28 ?. =(daf i.q.tub)
29 (fail tub)
30 (next tub)
31 ::
34Examples
35--------
37 ~zod/try=> ((just 'a') [[1 1] "abc"])
38 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
39 ~zod/try=> (scan "abc" (just 'a'))
40 ! {1 2}
41 ! 'syntax-error'
42 ! exit
43 ~zod/try=> (scan "a" (just 'a'))
44 ~~a
45 ~zod/try=> (scan "%" (just '%'))
46 ~~~25.
50***