You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/notation.md
+12
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,18 @@ The following notations are used by the *Lexer* and *Syntax* grammar snippets:
13
13
| x<sup>\*</sup> |_OuterAttribute_<sup>\*</sup> | 0 or more of x |
14
14
| x<sup>+</sup> |_MacroMatch_<sup>+</sup> | 1 or more of x |
15
15
| x<sup>a..b</sup> | HEX_DIGIT<sup>1..6</sup> | a to b repetitions of x |
16
+
| Rule1 Rule2 |`fn`_Name__Parameters_| Sequence of rules in order |
16
17
|\||`u8`\|`u16`, Block \| Item | Either one or another |
17
18
|\[]|\[`b``B`]| Any of the characters listed |
18
19
|\[ - ]|\[`a`-`z`]| Any of the characters in the range |
19
20
|~\[]|~\[`b``B`]| Any characters, except those listed |
20
21
|~`string`|~`\n`, ~`*/`| Any characters, except this sequence |
21
22
| ( ) | (`,`_Parameter_)<sup>?</sup> | Groups items |
23
+
| U+xxxx | U+0060 | A single unicode character |
24
+
|\<text\>|\<any ASCII char except CR\>| An English description of what should be matched |
25
+
| Rule <sub>suffix</sub> | IDENTIFIER_OR_KEYWORD <sub>_except `crate`_</sub> | A modification to the previous rule |
26
+
27
+
Sequences have a higher precedence than `|` alternation.
22
28
23
29
## String table productions
24
30
@@ -34,6 +40,12 @@ When such a string in `monospace` font occurs inside the grammar,
34
40
it is an implicit reference to a single member of such a string table
35
41
production. See [tokens] for more information.
36
42
43
+
## Railroad visualizations
44
+
45
+
Below each grammar block is a button to toggle the display of a [railroad diagram]. A square element is a non-terminal rule, and a rounded rectangle is a terminal.
0 commit comments