on master help sign in
Merge pull request #932 from urbit/parsing-edits

parsing docs followup

commit23e92af9f588af24b7c4adfc328620250f7eeb57 authorDavid Kerschner <david@tlon.io> dateMon 17 Aug 2020, 13:01 (6 years ago) parentf1c6f98ccd0c2a
2 files changed+8−4
tutorials/arvo/cli-tutorial.md+1−2 tutorials/arvo/parsing.md+7−2
tutorials/arvo/cli-tutorial.md+1−2
@@ -336,8 +336,7 @@ Here begins the implementation of the additional arms required by the
336336`+command-parser` is of central importance - it is what is used to parse user
337337input and transform it into `command`s for the app to execute. Writing a proper
338338command parser requires understanding of the Hoon parsing functions found in the
339−standard library. How to do so may be found in the parsing documentation (coming
340−soon). For now, it is sufficient to know that this arm matches the text "demo" and
339+standard library. How to do so may be found in the [parsing tutorial](@/docs/tutorials/arvo/parsing.md). For now, it is sufficient to know that this arm matches the text "demo" and
341340produces a `[? command]`-shaped noun in response. Note how the `&` signifies that the command will be run as soon as it has been entered, without waiting for the user to press return.
342341
343342
tutorials/arvo/parsing.md+7−2
@@ -397,7 +397,7 @@ Understanding the rune `;~` is essential to building parsers with Hoon. Let's
397397take this opportunity to think about it carefully.
398398
399399The `rule` created by `;~(combinator [list rule])` may be understood
400−inductively. To this, let's consider the base case where our `[list rule]` has only a
400+inductively. To do this, let's consider the base case where our `[list rule]` has only a
401401single entry.
402402```
403403> (scan "star" ;~(plug (jest 'star')))
@@ -428,7 +428,7 @@ the gluing operation. And so, swapping `+plug` for `+pose` results in a crash,
428428which clues us into the fact that the combinator now has an effect since there
429429is more than one `rule`.
430430```
431−`> (scan "star" ;~(pose (jest 'st') (jest 'ar')))
431+> (scan "star" ;~(pose (jest 'st') (jest 'ar')))
432432{1 3}
433433syntax error
434434```
@@ -536,6 +536,11 @@ your `gen/` folder.
536536--
537537```
538538
539+Informally, the grammar here is:
540+ - A factor is either an integer or an expression surrounded by parentheses.
541+ - A term is either a factor or a factor times a term.
542+ - An expression is either a term or a term plus an expression.
543+
539544### Factors, terms, and expressions
540545
541546Our grammar consists of three `rule`s: one for factors, one for terms, and one