on master help sign in
Merge pull request #932 from urbit/parsing-edits
23e92afDavid Kerschner
tutorials/arvo/cli-tutorial.md+1−2
@@ -336,8 +336,7 @@ Here begins the implementation of the additional arms required by the
336`+command-parser` is of central importance - it is what is used to parse user
336`+command-parser` is of central importance - it is what is used to parse user
337input and transform it into `command`s for the app to execute. Writing a proper
337input and transform it into `command`s for the app to execute. Writing a proper
338command parser requires understanding of the Hoon parsing functions found in the
338command 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
341produces 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.
340produces 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.
342
341
343
342
tutorials/arvo/parsing.md+7−2
@@ -397,7 +397,7 @@ Understanding the rune `;~` is essential to building parsers with Hoon. Let's
397take this opportunity to think about it carefully.
397take this opportunity to think about it carefully.
398
398
399The `rule` created by `;~(combinator [list rule])` may be understood
399The `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
401single entry.
401single entry.
402```
402```
403> (scan "star" ;~(plug (jest 'star')))
403> (scan "star" ;~(plug (jest 'star')))
@@ -428,7 +428,7 @@ the gluing operation. And so, swapping `+plug` for `+pose` results in a crash,
428which clues us into the fact that the combinator now has an effect since there
428which clues us into the fact that the combinator now has an effect since there
429is more than one `rule`.
429is more than one `rule`.
430```
430```
431−`> (scan "star" ;~(pose (jest 'st') (jest 'ar')))
431+> (scan "star" ;~(pose (jest 'st') (jest 'ar')))
432{1 3}
432{1 3}
433syntax error
433syntax error
434```
434```
@@ -536,6 +536,11 @@ your `gen/` folder.
536--
536--
537```
537```
538
538
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+
539### Factors, terms, and expressions
544### Factors, terms, and expressions
540
545
541Our grammar consists of three `rule`s: one for factors, one for terms, and one
546Our grammar consists of three `rule`s: one for factors, one for terms, and one