@@ -20,40 +20,34 @@ follows a few conventions:
2020- An arrow (→) is used to mark grammar productions and can be read as "can consist of."
2121- Syntactic categories are indicated by * italic* text and appear on both sides
2222 of a grammar production rule.
23- - Literal words and punctuation are indicated by boldface ` constant width ` text
23+ - Literal words and punctuation are indicated by ** ` boldface constant width ` ** text
2424 and appear only on the right-hand side of a grammar production rule.
2525- Alternative grammar productions are separated by vertical
2626 bars (|). When alternative productions are too long to read easily,
2727 they're broken into multiple grammar production rules on new lines.
2828- In a few cases, regular font text is used to describe the right-hand side
2929 of a grammar production rule.
3030- Optional syntactic categories and literals are marked by a trailing
31- subscript , * opt * .
31+ question mark , * ? * .
3232
3333As an example, the grammar of a getter-setter block is defined as follows:
3434
35- ```
36- Grammar of a getter-setter block
37-
38- getter-setter-block --> ``{`` getter-clause setter-clause-OPT ``}`` | ``{`` setter-clause getter-clause ``}``
39- ```
35+ > Grammar of a getter-setter block:
36+ >
37+ > * getter-setter-block* → ** ` { ` ** * getter-clause* * setter-clause* _ ?_ ** ` } ` ** | ** ` { ` ** * setter-clause* * getter-clause* ** ` } ` **
4038
4139This definition indicates that a getter-setter block can consist of a getter clause
4240followed by an optional setter clause, enclosed in braces,
4341* or* a setter clause followed by a getter clause, enclosed in braces.
4442The grammar production above is equivalent to the following two productions,
4543where the alternatives are spelled out explicitly:
4644
47- ```
48- Grammar of a getter-setter block
49-
50- getter-setter-block --> ``{`` getter-clause setter-clause-OPT ``}``
51- getter-setter-block --> ``{`` setter-clause getter-clause ``}``
52- ```
53-
54- * getter-setter-block* → ` { ` * getter-clause* * setter-clause?* ` } `
55-
56- * getter-setter-block* → ` { ` * setter-clause* * getter-clause* ` } `
45+ > Grammar of a getter-setter block:
46+ >
47+ >
48+ > * getter-setter-block* → ** ` { ` ** * getter-clause* * setter-clause* _ ?_ ** ` } ` **
49+ >
50+ > * getter-setter-block* → ** ` { ` ** * setter-clause* * getter-clause* ** ` } ` **
5751
5852<!--
5953This source file is part of the Swift.org open source project
0 commit comments