Skip to content

Commit 241677f

Browse files
committed
translate to Grammar of an availability condition
1 parent 4a56a37 commit 241677f

File tree

1 file changed

+84
-85
lines changed

1 file changed

+84
-85
lines changed

swift-6-beta.docc/ReferenceManual/SummaryOfTheGrammar.md

Lines changed: 84 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ make the same change here also.
553553
> *语句**声明* **`;`** 可选 \
554554
> *语句**循环语句* **`;`** 可选 \
555555
> *语句**分支语句* **`;`** 可选 \
556-
> *语句**带标签的语句* **`;`** 可选 \
556+
> *语句**标签语句* **`;`** 可选 \
557557
> *语句**控制转移语句* **`;`** 可选 \
558558
> *语句**延迟语句* **`;`** 可选 \
559559
> *语句**执行语句* **`;`** 可选 \
@@ -620,120 +620,119 @@ make the same change here also.
620620
> *switch-elseif 指令子句**elseif 指令* *编译条件* *switch-case 集* 可选 \
621621
> *switch-else 指令子句**else 指令* *switch-case 集* 可选
622622
623-
> Grammar of a labeled statement:
623+
> 标签语句的语法:
624624
>
625-
> *labeled-statement**statement-label* *loop-statement* \
626-
> *labeled-statement**statement-label* *if-statement* \
627-
> *labeled-statement**statement-label* *switch-statement* \
628-
> *labeled-statement**statement-label* *do-statement*
625+
> *标签语句**语句标签* *循环语句* \
626+
> *标签语句**语句标签* *if 语句* \
627+
> *标签语句**语句标签* *switch 语句* \
628+
> *标签语句**语句标签* *do 语句*
629629
>
630-
> *statement-label**label-name* **`:`** \
631-
> *label-name**identifier*
630+
> *语句标签**标签名称* **`:`** \
631+
> *标签名称**标识符*
632632
633-
> Grammar of a control transfer statement:
633+
> 控制转移语句的语法:
634634
>
635-
> *control-transfer-statement**break-statement* \
636-
> *control-transfer-statement**continue-statement* \
637-
> *control-transfer-statement**fallthrough-statement* \
638-
> *control-transfer-statement**return-statement* \
639-
> *control-transfer-statement**throw-statement*
635+
> *控制转移语句**break 语句* \
636+
> *控制转移语句**continue 语句* \
637+
> *控制转移语句**fallthrough 语句* \
638+
> *控制转移语句**return 语句* \
639+
> *控制转移语句**throw 语句*
640640
641-
> Grammar of a break statement:
641+
> break 语句的语法:
642642
>
643-
> *break-statement***`break`** *label-name*可选
643+
> *break 语句***`break`** *标签名称* 可选
644644
645-
> Grammar of a continue statement:
645+
> continue 语句的语法:
646646
>
647-
> *continue-statement***`continue`** *label-name*可选
647+
> *continue 语句***`continue`** *标签名称* 可选
648648
649-
> Grammar of a fallthrough statement:
649+
> fallthrough 语句的语法:
650650
>
651-
> *fallthrough-statement***`fallthrough`**
651+
> *fallthrough 语句***`fallthrough`**
652652
653-
> Grammar of a return statement:
653+
> return 语句的语法:
654654
>
655-
> *return-statement***`return`** *expression*可选
655+
> *return 语句***`return`** *表达式* 可选
656656
657-
> Grammar of a throw statement:
657+
> throw 语句的语法:
658658
>
659-
> *throw-statement***`throw`** *expression*
659+
> *throw 语句***`throw`** *表达式*
660660
661-
> Grammar of a defer statement:
661+
> defer 语句的语法:
662662
>
663-
> *defer-statement***`defer`** *code-block*
663+
> *defer 语句***`defer`** *代码块*
664664
665-
> Grammar of a do statement:
665+
> do 语句的语法:
666666
>
667-
> *do-statement***`do`** *throws-clause*可选 *code-block* *catch-clauses*可选 \
668-
> *catch-clauses**catch-clause* *catch-clauses*可选 \
669-
> *catch-clause***`catch`** *catch-pattern-list*可选 *code-block* \
670-
> *catch-pattern-list**catch-pattern* | *catch-pattern* **`,`** *catch-pattern-list* \
671-
> *catch-pattern**pattern* *where-clause*可选
667+
> *do 语句***`do`** *throws 子句* 可选 *代码块* *catch 子句* 可选 \
668+
> *catch 子句集**catch 子句* *catch 子句* 可选 \
669+
> *catch 子句***`catch`** *catch 模式列表* 可选 *代码块* \
670+
> *catch 模式列表**catch 模式* | *catch 模式* **`,`** *catch 模式列表* \
671+
> *catch 模式**模式* *where 子句* 可选
672672
673-
> Grammar of a compiler control statement:
673+
> 编译器控制语句的语法:
674674
>
675-
> *compiler-control-statement**conditional-compilation-block* \
676-
> *compiler-control-statement**line-control-statement* \
677-
> *compiler-control-statement**diagnostic-statement*
675+
> *编译器控制语句**条件编译块* \
676+
> *编译器控制语句**行控制语句* \
677+
> *编译器控制语句**诊断语句*
678678
679-
> Grammar of a conditional compilation block:
679+
> 条件编译块的语法:
680680
>
681-
> *conditional-compilation-block**if-directive-clause* *elseif-directive-clauses*可选 *else-directive-clause*可选 *endif-directive*
681+
> *条件编译块**if 指令子句* *elseif 指令子句集* 可选 *else 指令子句* 可选 *endif 指令* \
682+
> *if 指令子句**if 指令* *编译条件* *语句集合* 可选 \
683+
> *elseif 指令子句**elseif 指令子句* *elseif 指令子句集* 可选 \
684+
> *elseif 指令子句**elseif 指令* *编译条件* *语句集* 可选 \
685+
> *else 指令子句**else 指令* *语句集* 可选 \
686+
> *if 指令***`#if`** \
687+
> *elseif 指令***`#elseif`** \
688+
> *else 指令***`#else`** \
689+
> *endif 指令***`#endif`**
682690
>
683-
> *if-directive-clause**if-directive* *compilation-condition* *statements*可选 \
684-
> *elseif-directive-clauses**elseif-directive-clause* *elseif-directive-clauses*可选 \
685-
> *elseif-directive-clause**elseif-directive* *compilation-condition* *statements*可选 \
686-
> *else-directive-clause**else-directive* *statements*可选 \
687-
> *if-directive***`#if`** \
688-
> *elseif-directive***`#elseif`** \
689-
> *else-directive***`#else`** \
690-
> *endif-directive***`#endif`**
691+
> *编译条件**平台条件* \
692+
> *编译条件**标识符* \
693+
> *编译条件**布尔字面量* \
694+
> *编译条件***`(`** *编译条件* **`)`** \
695+
> *编译条件***`!`** *编译条件* \
696+
> *编译条件**编译条件* **`&&`** *编译条件* \
697+
> *编译条件**编译条件* **`||`** *编译条件*
691698
>
692-
> *compilation-condition**platform-condition* \
693-
> *compilation-condition**identifier* \
694-
> *compilation-condition**boolean-literal* \
695-
> *compilation-condition***`(`** *compilation-condition* **`)`** \
696-
> *compilation-condition***`!`** *compilation-condition* \
697-
> *compilation-condition**compilation-condition* **`&&`** *compilation-condition* \
698-
> *compilation-condition**compilation-condition* **`||`** *compilation-condition*
699+
> *平台条件***`os`** **`(`** *操作系统* **`)`** \
700+
> *平台条件***`arch`** **`(`** *体系结构* **`)`** \
701+
> *平台条件***`swift`** **`(`** **`>=`** *swift 版本* **`)`** | **`swift`** **`(`** **`<`** *swift 版本* **`)`** \
702+
> *平台条件***`compiler`** **`(`** **`>=`** *swift 版本* **`)`** | **`compiler`** **`(`** **`<`** *swift 版本* **`)`** \
703+
> *平台条件***`canImport`** **`(`** *导入路径* **`)`** \
704+
> *平台条件***`targetEnvironment`** **`(`** *环境* **`)`**
699705
>
700-
> *platform-condition***`os`** **`(`** *operating-system* **`)`** \
701-
> *platform-condition***`arch`** **`(`** *architecture* **`)`** \
702-
> *platform-condition***`swift`** **`(`** **`>=`** *swift-version* **`)`** | **`swift`** **`(`** **`<`** *swift-version* **`)`** \
703-
> *platform-condition***`compiler`** **`(`** **`>=`** *swift-version* **`)`** | **`compiler`** **`(`** **`<`** *swift-version* **`)`** \
704-
> *platform-condition***`canImport`** **`(`** *import-path* **`)`** \
705-
> *platform-condition***`targetEnvironment`** **`(`** *environment* **`)`**
706-
>
707-
> *operating-system***`macOS`** | **`iOS`** | **`watchOS`** | **`tvOS`** | **`visionOS`** | **`Linux`** | **`Windows`** \
708-
> *architecture***`i386`** | **`x86_64`** | **`arm`** | **`arm64`** \
709-
> *swift-version**decimal-digits* *swift-version-continuation*可选 \
710-
> *swift-version-continuation***`.`** *decimal-digits* *swift-version-continuation*可选 \
711-
> *environment***`simulator`** | **`macCatalyst`**
706+
> *操作系统***`macOS`** | **`iOS`** | **`watchOS`** | **`tvOS`** | **`visionOS`** | **`Linux`** | **`Windows`** \
707+
> *体系结构***`i386`** | **`x86_64`** | **`arm`** | **`arm64`** \
708+
> *swift 版本**十进制数字* *swift 版本延续* 可选 \
709+
> *swift 版本延续***`.`** *十进制数字* *swift 版本延续* 可选 \
710+
> *环境***`simulator`** | **`macCatalyst`**
712711
713-
> Grammar of a line control statement:
712+
> 行控制语句的语法:
714713
>
715-
> *line-control-statement***`#sourceLocation`** **`(`** **`file:`** *file-path* **`,`** **`line:`** *line-number* **`)`** \
716-
> *line-control-statement***`#sourceLocation`** **`(`** **`)`** \
717-
> *line-number*A decimal integer greater than zero \
718-
> *file-path**static-string-literal*
714+
> *行控制语句***`#sourceLocation`** **`(`** **`file:`** *文件路径* **`,`** **`line:`** *行号* **`)`** \
715+
> *行控制语句***`#sourceLocation`** **`(`** **`)`** \
716+
> *行号*大于零的十进制整数 \
717+
> *文件路径**静态字符串字面量*
719718
720-
> Grammar of an availability condition:
719+
> 可用性条件的语法:
721720
>
722-
> *availability-condition***`#available`** **`(`** *availability-arguments* **`)`** \
723-
> *availability-condition***`#unavailable`** **`(`** *availability-arguments* **`)`** \
724-
> *availability-arguments**availability-argument* | *availability-argument* **`,`** *availability-arguments* \
725-
> *availability-argument**platform-name* *platform-version* \
726-
> *availability-argument***`*`**
721+
> *可用性条件***`#available`** **`(`** *可用性参数* **`)`** \
722+
> *可用性条件***`#unavailable`** **`(`** *可用性参数* **`)`** \
723+
> *可用性参数**可用性参数* | *可用性参数* **`,`** *可用性参数* \
724+
> *可用性参数**平台名称* *平台版本* \
725+
> *可用性参数***`*`**
727726
>
728-
> *platform-name***`iOS`** | **`iOSApplicationExtension`** \
729-
> *platform-name***`macOS`** | **`macOSApplicationExtension`** \
730-
> *platform-name***`macCatalyst`** | **`macCatalystApplicationExtension`** \
731-
> *platform-name***`watchOS`** | **`watchOSApplicationExtension`** \
732-
> *platform-name***`tvOS`** | **`tvOSApplicationExtension`** \
733-
> *platform-name***`visionOS`** | **`visionOSApplicationExtension`** \
734-
> *platform-version**decimal-digits* \
735-
> *platform-version**decimal-digits* **`.`** *decimal-digits* \
736-
> *platform-version**decimal-digits* **`.`** *decimal-digits* **`.`** *decimal-digits*
727+
> *平台名称***`iOS`** | **`iOSApplicationExtension`** \
728+
> *平台名称***`macOS`** | **`macOSApplicationExtension`** \
729+
> *平台名称***`macCatalyst`** | **`macCatalystApplicationExtension`** \
730+
> *平台名称***`watchOS`** | **`watchOSApplicationExtension`** \
731+
> *平台名称***`tvOS`** | **`tvOSApplicationExtension`** \
732+
> *平台名称***`visionOS`** | **`visionOSApplicationExtension`** \
733+
> *平台版本**十进制数字* \
734+
> *平台版本**十进制数字* **`.`** *十进制数字* \
735+
> *平台版本**十进制数字* **`.`** *十进制数字* **`.`** *十进制数字*
737736
738737
## Declarations
739738

0 commit comments

Comments
 (0)