@@ -236,7 +236,7 @@ and returns a `rule`.
236### `+cold`
236### `+cold`
238`+cold` is a `rule` builder that takes in a constant noun we'll call `cus` and a
238`+cold` is a `rule` builder that takes in a constant noun we'll call `cus` and a
239−`rule` we'll call `sef` and returns a `rule` identical to the `sef` except it
239+`rule` we'll call `sef`. It returns a `rule` identical to the `sef` except it
240replaces the parsing result with `cus`.
240replaces the parsing result with `cus`.
242Here we see that `p.q` of the `edge` returned by the `rule` created with `+cold`
242Here we see that `p.q` of the `edge` returned by the `rule` created with `+cold`
@@ -267,8 +267,8 @@ utilizes parsers. That is to say, you'd like the programmer to only worry about
267passing `tape`s to the parser, and not have to dress up the `tape` as a `nail`
267passing `tape`s to the parser, and not have to dress up the `tape` as a `nail`
268themselves. Thus we have several functions for exactly this purpose.
268themselves. Thus we have several functions for exactly this purpose.
270−These functions take in either a `tape` or an `@` (typically representing a
270+These functions take in either a `tape` or a `cord`,
271−`cord`) with a `rule` and attempts to parse the input with the `rule`. If the
271+alongside a `rule`, and attempt to parse the input with the `rule`. If the
272parse succeeds, it returns the result. There are crashing and unitized versions
272parse succeeds, it returns the result. There are crashing and unitized versions
273of each caller, corresponding to what happens when a parse fails.
273of each caller, corresponding to what happens when a parse fails.
@@ -486,8 +486,11 @@ to write the above `rule` is as follows:
488 ;~ plug prn
488 ;~ plug prn
489− ;~ pose knee *tape
490+ (knee *tape |.(^$))
490− |. ^$ (easy ~)
491+ (easy ~)
493You may want to utilize the `~+` rune when writing recursive parsers to cache
496You may want to utilize the `~+` rune when writing recursive parsers to cache
@@ -516,12 +519,12 @@ First lets look at the code we're going to use, and then dive into explaining
516it. If you'd like to follow along, save the following as `expr-parse.hoon` in
519it. If you'd like to follow along, save the following as `expr-parse.hoon` in
517your `gen/` folder.
520your `gen/` folder.
519−:: expr-parse: parse arithmetic expressions
522+:: expr-parse: parse arithmetic expressions
521|= xprs=tape
524|= xprs=tape
522|^ (scan xprs tape)
525|^ (scan xprs tape)
524− %+ knee @ud
527+ %+ knee *@ud
@@ -554,7 +557,8 @@ for expressions.
556 %+ knee @ud
559 %+ knee @ud
557− |. ~+ ;~ pose
561+ ;~ pose
559 (ifix [lit rit] expr)
563 (ifix [lit rit] expr)
@@ -570,7 +574,7 @@ with `+pose`, which says to try each rule in succession until one of them works.
571Since expressions ultimately reduce to factors, we are actually building a
575Since expressions ultimately reduce to factors, we are actually building a
572recursive rule. Thus we need to make use of `+knee`. The first argument for
576recursive rule. Thus we need to make use of `+knee`. The first argument for
573−`+knee` is `@ud`, since our final answer should be a `@ud`.
577+`+knee` is `*@ud`, since our final answer should be a `@ud`.
575Then follows the definition of the gate utilized by `+knee`:
579Then follows the definition of the gate utilized by `+knee`: