fix wrong links, fix #1086
This commit is contained in:
@ -64,7 +64,7 @@ for item in collection {
|
||||
>
|
||||
|
||||
#### for-in-statement {#for-in-statement}
|
||||
> *for-in 语句* → **for** **case**<sub>可选</sub> [模式](./08_Patterns.md#pattern) **in** [表达式](./04-Expressions.md#expression) [where 子句](#where-clause)<sub>可选</sub> [代码块](05-Declarations.md#code-block)
|
||||
> *for-in 语句* → **for** **case**<sub>可选</sub> [模式](./08_Patterns.md#pattern) **in** [表达式](./04_Expressions.md#expression) [where 子句](#where-clause)<sub>可选</sub> [代码块](./06_Declarations.md#code-block)
|
||||
>
|
||||
|
||||
### While 语句 {#while-statements}
|
||||
@ -92,12 +92,12 @@ while condition {
|
||||
>
|
||||
|
||||
#### while-statement {#while-statement}
|
||||
> *while 语句* → **while** [条件子句](#condition-clause) [代码块](./05-Declarations.md#code-block)
|
||||
> *while 语句* → **while** [条件子句](#condition-clause) [代码块](./06_Declarations.md#code-block)
|
||||
>
|
||||
|
||||
|
||||
#### condition-clause {#condition-clause}
|
||||
> *条件子句* → [表达式](./04_Expressions.md#expression) | [表达式](./04-Expressions.md#expression) **,** [条件列表](#condition-list)
|
||||
> *条件子句* → [表达式](./04_Expressions.md#expression) | [表达式](./04_Expressions.md#expression) **,** [条件列表](#condition-list)
|
||||
>
|
||||
|
||||
#### condition {#condition}
|
||||
@ -106,11 +106,11 @@ while condition {
|
||||
>
|
||||
|
||||
#### case-condition {#case-condition}
|
||||
> *case 条件* → **case** [模式](./08_Patterns.md#pattern) [构造器](./06-Declarations.md#initializer)
|
||||
> *case 条件* → **case** [模式](./08_Patterns.md#pattern) [构造器](./06_Declarations.md#initializer)
|
||||
>
|
||||
|
||||
#### optional-binding-condition {#optional-binding-condition}
|
||||
> *可选绑定条件* → **let** [模式](./08_Patterns.md#pattern) [构造器](./06-Declarations.md#initializer) | **var** [模式](./08-Patterns.md#pattern) [构造器](./06-Declarations.md#initializer)
|
||||
> *可选绑定条件* → **let** [模式](./08_Patterns.md#pattern) [构造器](./06_Declarations.md#initializer) | **var** [模式](./08_Patterns.md#pattern) [构造器](./06_Declarations.md#initializer)
|
||||
>
|
||||
|
||||
### Repeat-While 语句 {#repeat-while-statements}
|
||||
@ -138,7 +138,7 @@ repeat {
|
||||
>
|
||||
|
||||
#### repeat-while-statement {#repeat-while-statement}
|
||||
> *repeat-while 语句* → **repeat** [代码块](./06_Declarations.md#code-block) **while** [表达式](./04-Expressions.md#expression)
|
||||
> *repeat-while 语句* → **repeat** [代码块](./06_Declarations.md#code-block) **while** [表达式](./04_Expressions.md#expression)
|
||||
>
|
||||
|
||||
## 分支语句 {#branch-statements}
|
||||
@ -200,7 +200,7 @@ if condition 1 {
|
||||
>
|
||||
|
||||
#### if-statement {#if-statement}
|
||||
> *if 语句* → **if** [条件子句](#condition-clause) [代码块](05-Declarations.md#code-block) [else 子句](#else-clause)<sub>可选</sub>
|
||||
> *if 语句* → **if** [条件子句](#condition-clause) [代码块](./06_Declarations.md#code-block) [else 子句](#else-clause)<sub>可选</sub>
|
||||
>
|
||||
|
||||
#### else-clause {#else-clause}
|
||||
@ -228,14 +228,14 @@ guard condition else {
|
||||
* `continue`
|
||||
* `throw`
|
||||
|
||||
关于控制转移语句,请参阅 [控制转移语句](#control-transfer-statements)。关于 `Never` 返回类型的函数,请参阅 [永不返回的函数](05-Declarations.md#rethrowing-functions-and-methods)。
|
||||
关于控制转移语句,请参阅 [控制转移语句](#control-transfer-statements)。关于 `Never` 返回类型的函数,请参阅 [永不返回的函数](./06_Declarations.md#rethrowing-functions-and-methods)。
|
||||
|
||||
> guard 语句语法
|
||||
>
|
||||
>
|
||||
|
||||
#### guard-statement {#guard-statement}
|
||||
> *guard 语句* → **guard** [条件子句](#condition-clause) **else** [代码块](05-Declarations.md#code-block)
|
||||
> *guard 语句* → **guard** [条件子句](#condition-clause) **else** [代码块](./06_Declarations.md#code-block)
|
||||
|
||||
### Switch 语句 {#switch-statements}
|
||||
|
||||
@ -325,7 +325,7 @@ case .suppressed:
|
||||
>
|
||||
|
||||
#### case-item-list {#case-item-list}
|
||||
> *case 项列表* → [模式](./08_Patterns.md#pattern) [where 子句](#where-clause)<sub>可选</sub> | [模式](07-Patterns.md#pattern) [where 子句](#where-clause)<sub>可选</sub> **,** [case 项列表](#case-item-list)
|
||||
> *case 项列表* → [模式](./08_Patterns.md#pattern) [where 子句](#where-clause)<sub>可选</sub> | [模式](./08_Patterns.md#pattern) [where 子句](#where-clause)<sub>可选</sub> **,** [case 项列表](#case-item-list)
|
||||
>
|
||||
|
||||
#### default-label {#default-label}
|
||||
@ -424,7 +424,7 @@ case .suppressed:
|
||||
|
||||
无论哪种情况,控制权都会被转移给被终止的控制流语句后面的第一行语句。
|
||||
|
||||
关于使用 `break` 语句的例子,请参阅 [控制流](../02_language_guide/05_Control_Flow.md) 一章的 [Break](../02_language_guide/05_Control_Flow.md#break) 和 [带标签的语句](../02-language-guide/05-Control-Flow.md#labeled-statements)。
|
||||
关于使用 `break` 语句的例子,请参阅 [控制流](../02_language_guide/05_Control_Flow.md) 一章的 [Break](../02_language_guide/05_Control_Flow.md#break) 和 [带标签的语句](../02_language_guide/05_Control_Flow.md#labeled-statements)。
|
||||
|
||||
> break 语句语法
|
||||
>
|
||||
@ -450,7 +450,7 @@ case .suppressed:
|
||||
|
||||
在 `for` 语句中,`continue` 语句执行后,增量表达式还是会被计算,这是因为每次循环体执行完毕后,增量表达式都会被计算。
|
||||
|
||||
关于使用 `continue` 语句的例子,请参阅 [控制流](../02_language_guide/05_Control_Flow.md) 一章的 [Continue](../02_language_guide/05_Control_Flow.md#continue) 和 [带标签的语句](../02-language-guide/05-Control-Flow.md#labeled-statements)。
|
||||
关于使用 `continue` 语句的例子,请参阅 [控制流](../02_language_guide/05_Control_Flow.md) 一章的 [Continue](../02_language_guide/05_Control_Flow.md#continue) 和 [带标签的语句](../02_language_guide/05_Control_Flow.md#labeled-statements)。
|
||||
|
||||
> continue 语句语法
|
||||
>
|
||||
@ -500,7 +500,7 @@ case .suppressed:
|
||||
>
|
||||
|
||||
#### return-statement {#return-statement}
|
||||
> *return 语句* → **return** [表达式](./04_Expressions.html#expression)<sub>可选</sub>
|
||||
> *return 语句* → **return** [表达式](./04_Expressions.md#expression)<sub>可选</sub>
|
||||
|
||||
### Throw 语句 {#throw-statements}
|
||||
|
||||
@ -607,13 +607,13 @@ do {
|
||||
>
|
||||
|
||||
#### catch-clause {#catch-clause}
|
||||
> *catch 子句* → **catch** [模式](./08_Patterns.md#pattern)<sub>可选</sub> [where 子句](#where-clause)<sub>可选</sub> [代码块](05-Declarations.md#code-block)
|
||||
> *catch 子句* → **catch** [模式](./08_Patterns.md#pattern)<sub>可选</sub> [where 子句](#where-clause)<sub>可选</sub> [代码块](./06_Declarations.md#code-block)
|
||||
|
||||
#### catch-pattern-list{#catch-pattern-list}
|
||||
> *catch 模式列表* → [catch 模式](#catch-pattern) | [catch 模式](#catch-pattern) ,[catch 模式列表](#catch-pattern-list)
|
||||
|
||||
#### catch-pattern{#catch-pattern}
|
||||
> *catch 模式* → [模式](./08_Patterns.md#pattern) [where 子句](./05-Statements.md#where-clause)<sub>可选</sub>
|
||||
> *catch 模式* → [模式](./08_Patterns.md#pattern) [where 子句](./05_Statements.md#where-clause)<sub>可选</sub>
|
||||
|
||||
## 编译器控制语句 {#compiler-control-statements}
|
||||
编译器控制语句允许程序改变编译器的行为。Swift 有三种编译器控制语句:条件编译语句、线路控制语句和编译时诊断语句。
|
||||
@ -898,6 +898,6 @@ if #available(platform name version, ..., *) {
|
||||
#### platform-version {#platform-version}
|
||||
> *平台版本* → [十进制数字](./02_Lexical_Structure.md#decimal-digits)
|
||||
>
|
||||
> *平台版本* → [十进制数字](./02_Lexical_Structure.md#decimal-digits) **.** [十进制数字](./02-Lexical-Structure.md#decimal-digits)
|
||||
> *平台版本* → [十进制数字](./02_Lexical_Structure.md#decimal-digits) **.** [十进制数字](./02_Lexical_Structure.md#decimal-digits)
|
||||
>
|
||||
> *平台版本* → [十进制数字](./02_Lexical_Structure.md#decimal-digits) **.** [十进制数字](./02-Lexical-Structure.md#decimal-digits) **.** [十进制数字](./02-Lexical-Structure.md#decimal-digits)
|
||||
> *平台版本* → [十进制数字](./02_Lexical_Structure.md#decimal-digits) **.** [十进制数字](./02_Lexical_Structure.md#decimal-digits) **.** [十进制数字](./02_Lexical_Structure.md#decimal-digits)
|
||||
|
||||
Reference in New Issue
Block a user