@@ -39,16 +39,16 @@ that are plugged into one another in various ways to perform the desired task.
40The basic building blocks, or primitives, are parsers that read only a
40The basic building blocks, or primitives, are parsers that read only a
41single character. There are frequently a few types of possible input characters,
41single character. There are frequently a few types of possible input characters,
42−such as letters, numbers, and symbols. For example, `parse("1", integer)` calls
42+such as letters, numbers, and symbols. For example, `(parse "1" integer)` calls
43the parsing routine on the string `"1"` and looks for an integer, and so it
43the parsing routine on the string `"1"` and looks for an integer, and so it
44returns the integer `1`. However, taking into account what was said above about
44returns the integer `1`. However, taking into account what was said above about
45parsers returning the unparsed portion of the string as well, we should
45parsers returning the unparsed portion of the string as well, we should
46represent this return as a tuple. So we should expect something like this:
46represent this return as a tuple. So we should expect something like this:
48−> parse("1", integer)
48+> (parse "1" integer)
50−> parse("123", integer)
50+> (parse "123" integer)
53What if we wish to parse the rest of the string? We would need to apply the
53What if we wish to parse the rest of the string? We would need to apply the
54`parse` function again:
54`parse` function again:
@@ -57,6 +57,10 @@ What if we wish to parse the rest of the string? We would need to apply the
58> parse(parse(parse("123", integer), integer), integer)
58> parse(parse(parse("123", integer), integer), integer)
60+> (parse (parse "123" integer) integer)
62+> (parse (parse (parse "123" integer) integer) integer)
61So we see that we can parse strings larger than one character by stringing
65So we see that we can parse strings larger than one character by stringing
62together parsing functions for single characters. Thus in addition to parsing
66together parsing functions for single characters. Thus in addition to parsing
@@ -179,9 +183,7 @@ parser has not advanced since parsing failed. `q.edg` is null, indicating that
179parsing has failed.
183parsing has failed.
181Later we will use [+star](#star) to string together a sequence of `+just`s in
185Later we will use [+star](#star) to string together a sequence of `+just`s in
182−order to parse multiple characters at once. However, it should be noted that
186+order to parse multiple characters at once.
183−`+jest`, which is covered next, ought to be used in favor of `+just`, which is
184−mostly included here for pedagogical reasons.
186### `+jest`
188### `+jest`
@@ -531,14 +533,14 @@ your `gen/` folder.
531 (ifix [lit rit] expr)
533 (ifix [lit rit] expr)
534− %+ knee @ud
536+ %+ knee *@ud
537 ((slug mul) tar ;~(pose factor turm))
539 ((slug mul) tar ;~(pose factor turm))
541− %+ knee @ud
543+ %+ knee *@ud
544 ((slug add) lus ;~(pose turm expr))
546 ((slug add) lus ;~(pose turm expr))
@@ -556,7 +558,7 @@ for expressions.
559− %+ knee @ud
561+ %+ knee *@ud
@@ -623,8 +625,9 @@ for expressions, we just need to swap `lus` for `tar`, `add` for `mul`, and
626− %+ knee *int
628+ %+ knee *@ud
627− |. ~+ ;~ pose
630+ ;~ pose
628 ((slug add) lus ;~(pose turm expr))
631 ((slug add) lus ;~(pose turm expr))