|
1 | 1 | # 属性\(Attributes\)
|
2 | 2 |
|
3 |
| -最終更新日: 2023/6/3 |
| 3 | +最終更新日: 2023/8/11 |
4 | 4 | 原文: https://docs.swift.org/swift-book/ReferenceManual/Attributes.html
|
5 | 5 |
|
6 | 6 | 宣言と型に情報を追加する。
|
@@ -804,15 +804,16 @@ switch の case 属性は、switch 文のケースにのみ適用できます。
|
804 | 804 |
|
805 | 805 | この属性を switch ケースに適用すると、コードのコンパイル時にわかっているどの列挙ケースとも一致することがない可能性を示します。`unknown` 属性の使用方法の例については、[Switching Over Future Enumeration Cases\(列挙型の将来のケースのスイッチング\)](../language-reference/statements.md#switching-over-future-enumeration-cases)を参照ください。
|
806 | 806 |
|
807 |
| -> GRAMMAR OF AN ATTRIBUTE |
808 |
| -> attribute → `@` [attribute-name](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_attribute-name) [attribute-argument-clause](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_attribute-argument-clause)<sub>opt</sub> |
809 |
| -> attribute-name → [identifier](https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_identifier) |
810 |
| -> attribute-argument-clause → `(` [balanced-tokens](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_balanced-tokens)<sub>opt</sub> `)` |
811 |
| -> attributes → [attribute](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_attribute) [attributes](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_attributes)<sub>opt</sub> |
812 |
| -> balanced-tokens → [balanced-token](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_balanced-token) [balanced-tokens](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_balanced-tokens)<sub>opt</sub> |
813 |
| -> balanced-token → `(` [balanced-tokens](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_balanced-tokens)<sub>opt</sub> `)` |
814 |
| -> balanced-token → `[` [balanced-tokens](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_balanced-tokens)<sub>opt</sub> `]` |
815 |
| -> balanced-token → `{` [balanced-tokens](https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#grammar_balanced-tokens)<sub>opt</sub> `}` |
816 |
| -> balanced-token → 任意の識別子、キーワード、リテラル、または演算子 |
817 |
| -> balanced-token → `(`, `)`, `[`, `]`, `{`, または `}` を除く任意の句読点 |
818 |
| -
|
| 807 | +> Grammar of an attribute: |
| 808 | +> |
| 809 | +> *attribute* → **`@`** *attribute-name* *attribute-argument-clause*_?_ \ |
| 810 | +> *attribute-name* → *identifier* \ |
| 811 | +> *attribute-argument-clause* → **`(`** *balanced-tokens*_?_ **`)`** \ |
| 812 | +> *attributes* → *attribute* *attributes*_?_ |
| 813 | +> |
| 814 | +> *balanced-tokens* → *balanced-token* *balanced-tokens*_?_ \ |
| 815 | +> *balanced-token* → **`(`** *balanced-tokens*_?_ **`)`** \ |
| 816 | +> *balanced-token* → **`[`** *balanced-tokens*_?_ **`]`** \ |
| 817 | +> *balanced-token* → **`{`** *balanced-tokens*_?_ **`}`** \ |
| 818 | +> *balanced-token* → 任意の識別子、キーワード、リテラル、または演算子 \ |
| 819 | +> *balanced-token* → **`(`**, **`)`**, **`[`**, **`]`**, **`{`**, または **`}`** を除く任意の句読点 |
0 commit comments