Skip to content

Commit fd70409

Browse files
committed
Add rule identifiers to notation chapter
We originally hadn't added rule identifiers to the notation chapter as in some sense these aren't language rules. However, as it turns out, it's still useful to have these so as to be able to refer by name to particular sections. And anyway, since the language rules are defined in terms of this notation, the notation rules are in a sense normative at a meta level. In doing this, we'll nest certain sections under the grammar section that should be so nested.
1 parent 62286c1 commit fd70409

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/notation.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
r[notation]
12
# Notation
23

4+
r[notation.grammar]
35
## Grammar
46

7+
r[notation.grammar.syntax]
8+
59
The following notations are used by the *Lexer* and *Syntax* grammar snippets:
610

711
| Notation | Examples | Meaning |
@@ -26,7 +30,8 @@ The following notations are used by the *Lexer* and *Syntax* grammar snippets:
2630

2731
Sequences have a higher precedence than `|` alternation.
2832

29-
## String table productions
33+
r[notation.grammar.string-tables]
34+
### String table productions
3035

3136
Some rules in the grammar — notably [unary operators], [binary
3237
operators], and [keywords] — are given in a simplified form: as a listing
@@ -40,13 +45,15 @@ When such a string in `monospace` font occurs inside the grammar,
4045
it is an implicit reference to a single member of such a string table
4146
production. See [tokens] for more information.
4247

43-
## Grammar visualizations
48+
r[notation.grammar.visualizations]
49+
### Grammar visualizations
4450

4551
Below each grammar block is a button to toggle the display of a [syntax diagram]. A square element is a non-terminal rule, and a rounded rectangle is a terminal.
4652

4753
[syntax diagram]: https://en.wikipedia.org/wiki/Syntax_diagram
4854

49-
## Common productions
55+
r[notation.grammar.common]
56+
### Common productions
5057

5158
The following are common definitions used in the grammar.
5259

0 commit comments

Comments
 (0)