2title = "4g: Parsing (Outside Caller)"
11Parse a cord with a given `rule` and crash if the `cord` isn't entirely
22The value of the parse result, or crash.
27++ rash |*([naf=@ sab=rule] (scan (trip naf) sab))
33> (rash 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
34"I was the world in which I walked, and what I saw"
36> (rash 'abc' (just 'a'))
41> (rash 'abc' (jest 'abc'))
44> (rash 'abc' (jest 'ab'))
56Parse `tape` `los` with `rule` `sab`, producing an `(each @ud (unit *))`. If
57`los` was not fully consumed, the result is `%.n` and `p` contains the column
58number before failure occurred. If `los` was fully consumed, the result is
59`%.y` and `p` contains either `sab`'s result in a `unit`, or a null `unit` if
70`(each @ud (unit *))`, where the `*` is whatever type the `rule` produces.
75++ rose |* [los=tape sab=rule]
76 =+ vex=(sab [[1 1] los])
78 ?. =(+(len) q.p.vex) [%| p=(dec q.p.vex)]
81 [%& p=[~ u=p.u.q.vex]]
96> (rose "!" ;~(plug zap fail))
106Parse an atom with a given rule and produce null if the cord isn't
117The value of the parse result, or null.
122++ rush |*([naf=@ sab=rule] (rust (trip naf) sab))
128> (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
129[~ "I was the world in which I walked, and what I saw"]
131> (rush 'abc' (just 'a'))
134> (rush 'abc' (jest 'abc'))
137> (rush 'abc' (jest 'ac'))
140> (rush 'abc' (jest 'ab'))
150Parse a `tape` with a given `rule` and produce null if the `tape` isn't
161A `(unit *)`, where `*` is the type produced by `sab`.
166++ rust |* [los=tape sab=rule]
167 =+ vex=((full sab) [[1 1] los])
168 ?~(q.vex ~ [~ u=p.u.q.vex])
174> (rust "I was the world in which I walked, and what I saw" (star (shim 0 200)))
175[~ "I was the world in which I walked, and what I saw"]
177> (rust "Or heard or felt came not but from myself;" (star (shim 0 200)))
178[~ "Or heard or felt came not but from myself;"]
180> (rust "And there I found myself more truly and more strange." (jest 'And there I'))
190Parse a `tape` with a given `rule` and crash if the `tape` isn't entirely
201Either a `tape` or a crash.
206++ scan |* [los=tape sab=rule]
207 =+ vex=((full sab) [[1 1] los])
209 ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
210 ~_(leaf+"syntax error" !!)
217> (scan "I was the world in which I walked, and what I saw" (star (shim 0 200)))
218"I was the world in which I walked, and what I saw"
220> (scan "Or heard or felt came not but from myself;" (star (shim 0 200)))
221"Or heard or felt came not but from myself;"
223> (scan "And there I found myself more truly and more strange." (jest 'And there I'))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list