Skip to content

Commit 4039ee0

Browse files
committed
Convert grammar to DocC flavored markdown.
This is the same content that the previous commit added to the summary chapter, copy/pasted throughout the other chapters it the reference.
1 parent 96ffcb6 commit 4039ee0

File tree

9 files changed

+1521
-1153
lines changed

9 files changed

+1521
-1153
lines changed

Sources/TSPL/TSPL.docc/ReferenceManual/AboutTheLanguageReference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ As an example, the grammar of a getter-setter block is defined as follows:
3434

3535
> Grammar of a getter-setter block:
3636
>
37-
> *getter-setter-block***`{`** *getter-clause* *setter-clause* _?_ **`}`** | **`{`** *setter-clause* *getter-clause* **`}`**
37+
> *getter-setter-block***`{`** *getter-clause* *setter-clause*_?_ **`}`** | **`{`** *setter-clause* *getter-clause* **`}`**
3838
3939
This definition indicates that a getter-setter block can consist of a getter clause
4040
followed by an optional setter clause, enclosed in braces,
@@ -45,9 +45,9 @@ where the alternatives are spelled out explicitly:
4545
> Grammar of a getter-setter block:
4646
>
4747
>
48-
> *getter-setter-block***`{`** *getter-clause* *setter-clause?* **`}`**
48+
> *getter-setter-block***`{`** *getter-clause* *setter-clause*_?_ **`}`**
4949
>
50-
> *getter-setter-block***`{`** setter-clause getter-clause **`}`**
50+
> *getter-setter-block***`{`** *setter-clause* *getter-clause* **`}`**
5151
5252
@Comment {
5353
This source file is part of the Swift.org open source project

Sources/TSPL/TSPL.docc/ReferenceManual/Attributes.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,21 +2235,30 @@ at the time the code is compiled.
22352235
For an example of how to use the `unknown` attribute,
22362236
see <doc:Statements#Switching-Over-Future-Enumeration-Cases>.
22372237

2238-
```
2239-
Grammar of an attribute
2240-
2241-
attribute --> ``@`` attribute-name attribute-argument-clause-OPT
2242-
attribute-name --> identifier
2243-
attribute-argument-clause --> ``(`` balanced-tokens-OPT ``)``
2244-
attributes --> attribute attributes-OPT
2245-
2246-
balanced-tokens --> balanced-token balanced-tokens-OPT
2247-
balanced-token --> ``(`` balanced-tokens-OPT ``)``
2248-
balanced-token --> ``[`` balanced-tokens-OPT ``]``
2249-
balanced-token --> ``{`` balanced-tokens-OPT ``}``
2250-
balanced-token --> Any identifier, keyword, literal, or operator
2251-
balanced-token --> Any punctuation except ``(``, ``)``, ``[``, ``]``, ``{``, or ``}``
2252-
```
2238+
> Grammar of an attribute:
2239+
>
2240+
> *attribute***`@`** *attribute-name* *attribute-argument-clause*_?_
2241+
>
2242+
> *attribute-name**identifier*
2243+
>
2244+
> *attribute-argument-clause***`(`** *balanced-tokens*_?_ **`)`**
2245+
>
2246+
> *attributes**attribute* *attributes*_?_
2247+
>
2248+
>
2249+
>
2250+
> *balanced-tokens**balanced-token* *balanced-tokens*_?_
2251+
>
2252+
> *balanced-token***`(`** *balanced-tokens*_?_ **`)`**
2253+
>
2254+
> *balanced-token***`[`** *balanced-tokens*_?_ **`]`**
2255+
>
2256+
> *balanced-token***`{`** *balanced-tokens*_?_ **`}`**
2257+
>
2258+
> *balanced-token* → Any identifier, keyword, literal, or operator
2259+
>
2260+
> *balanced-token* → Any punctuation except **`(`**, **`)`**, **`[`**, **`]`**, **`{`**, or **`}`**
2261+
22532262

22542263

22552264

0 commit comments

Comments
 (0)