authorgravatar for genericpb@gmail.comextrasharp <genericpb@gmail.com> 2020-08-24 13:12:23-05:00
committergravatar for genericpb@gmail.comextrasharp <genericpb@gmail.com> 2020-08-24 13:12:23-05:00
log4d1710c8993b6834bf17bf68fe8cb481c7a8aae9
tree9373f15092c6db846769e207294fdee3c9bac12e
parent7d6ed1cd854422613f0bf9dc8d54362dec4eca98

Make changes


1 files changed, 40 insertions(+), 24 deletions(-)

doc/langref.html.in+40-24
......@@ -10322,7 +10322,8 @@ fn readU32Be() u32 {}
1032210322 <pre>{#syntax#}align{#endsyntax#}</pre>
1032310323 </td>
1032410324 <td>
10325 {#syntax#}align{#endsyntax#} can be used to specify the alignment of a pointer. It can also be used after a variable or function declaration to specify the alignment of pointers to that variable or function.
10325 {#syntax#}align{#endsyntax#} can be used to specify the alignment of a pointer.
10326 It can also be used after a variable or function declaration to specify the alignment of pointers to that variable or function.
1032610327 <ul>
1032710328 <li>See also {#link|Alignment#}</li>
1032810329 </ul>
......@@ -10366,7 +10367,8 @@ fn readU32Be() u32 {}
1036610367 <pre>{#syntax#}anytype{#endsyntax#}</pre>
1036710368 </td>
1036810369 <td>
10369 Function parameters can be declared with {#syntax#}anytype{#endsyntax#} in place of the type. The parameter type will be inferred where the function is called.
10370 Function parameters and struct fields can be declared with {#syntax#}anytype{#endsyntax#} in place of the type.
10371 The type will be inferred where the function is called or the struct is instantiated.
1037010372 <ul>
1037110373 <li>See also {#link|Function Parameter Type Inference#}</li>
1037210374 </ul>
......@@ -10399,7 +10401,8 @@ fn readU32Be() u32 {}
1039910401 <pre>{#syntax#}await{#endsyntax#}</pre>
1040010402 </td>
1040110403 <td>
10402 {#syntax#}await{#endsyntax#} can be used to suspend the current function until the frame provided after the {#syntax#}await{#endsyntax#} completes. {#syntax#}await{#endsyntax#} copies the value returned from the target function's frame to the caller.
10404 {#syntax#}await{#endsyntax#} can be used to suspend the current function until the frame provided after the {#syntax#}await{#endsyntax#} completes.
10405 {#syntax#}await{#endsyntax#} copies the value returned from the target function's frame to the caller.
1040310406 <ul>
1040410407 <li>See also {#link|Async Functions#}</li>
1040510408 </ul>
......@@ -10410,8 +10413,8 @@ fn readU32Be() u32 {}
1041010413 <pre>{#syntax#}break{#endsyntax#}</pre>
1041110414 </td>
1041210415 <td>
10413 {#syntax#}break{#endsyntax#} can be used to exit a loop before iteration completes naturally.
10414 It can also be used with a block label to return a value from the block.
10416 {#syntax#}break{#endsyntax#} can be used with a block label to return a value from the block.
10417 It can also be used to exit a loop before iteration completes naturally.
1041510418 <ul>
1041610419 <li>See also {#link|blocks#}, {#link|while#}, {#link|for#}</li>
1041710420 </ul>
......@@ -10422,7 +10425,8 @@ fn readU32Be() u32 {}
1042210425 <pre>{#syntax#}catch{#endsyntax#}</pre>
1042310426 </td>
1042410427 <td>
10425 {#syntax#}catch{#endsyntax#} can be used to provide a default value for an error union, or capture its error value in an expression.
10428 {#syntax#}catch{#endsyntax#} can be used to evaluate an expression if the expression before it evaluates to an error.
10429 The expression after the {#syntax#}catch{#endsyntax#} can optionally capture the error value.
1042610430 <ul>
1042710431 <li>See also {#link|catch#}, {#link|Operators#}</li>
1042810432 </ul>
......@@ -10446,6 +10450,7 @@ fn readU32Be() u32 {}
1044610450 </td>
1044710451 <td>
1044810452 {#syntax#}const{#endsyntax#} declares a variable that can not be modified.
10453 Used as a pointer attribute, it denotes the value referenced by the pointer cannot be modified.
1044910454 <ul>
1045010455 <li>See also {#link|Variables#}</li>
1045110456 </ul>
......@@ -10467,7 +10472,7 @@ fn readU32Be() u32 {}
1046710472 <pre>{#syntax#}defer{#endsyntax#}</pre>
1046810473 </td>
1046910474 <td>
10470 {#syntax#}defer{#endsyntax#} will execute an expression at the end of the current block.
10475 {#syntax#}defer{#endsyntax#} will execute an expression when control flow leaves the current block.
1047110476 <ul>
1047210477 <li>See also {#link|defer#}</li>
1047310478 </ul>
......@@ -10478,7 +10483,8 @@ fn readU32Be() u32 {}
1047810483 <pre>{#syntax#}else{#endsyntax#}</pre>
1047910484 </td>
1048010485 <td>
10481 {#syntax#}else{#endsyntax#} can be used to provide an alternate branch for {#syntax#}if{#endsyntax#}, {#syntax#}switch{#endsyntax#}, {#syntax#}while{#endsyntax#}, and {#syntax#}for{#endsyntax#} expressions.
10486 {#syntax#}else{#endsyntax#} can be used to provide an alternate branch for {#syntax#}if{#endsyntax#}, {#syntax#}switch{#endsyntax#},
10487 {#syntax#}while{#endsyntax#}, and {#syntax#}for{#endsyntax#} expressions.
1048210488 <ul>
1048310489 <li>If used after an if expression, the else branch will be executed if the test value returns false, null, or an error.</li>
1048410490 <li>If used within a switch expression, the else branch will be executed if the test value matches no other cases.</li>
......@@ -10492,7 +10498,7 @@ fn readU32Be() u32 {}
1049210498 <pre>{#syntax#}enum{#endsyntax#}</pre>
1049310499 </td>
1049410500 <td>
10495 {#syntax#}enum{#endsyntax#} defines an anonymous enum type.
10501 {#syntax#}enum{#endsyntax#} defines an enum type.
1049610502 <ul>
1049710503 <li>See also {#link|enum#}</li>
1049810504 </ul>
......@@ -10503,7 +10509,7 @@ fn readU32Be() u32 {}
1050310509 <pre>{#syntax#}errdefer{#endsyntax#}</pre>
1050410510 </td>
1050510511 <td>
10506 {#syntax#}errdefer{#endsyntax#} will execute an expression at the end of the current block if and only if the block returns an error.
10512 {#syntax#}errdefer{#endsyntax#} will execute an expression when control flow leaves the current block if the function returns an error.
1050710513 <ul>
1050810514 <li>See also {#link|errdefer#}</li>
1050910515 </ul>
......@@ -10514,7 +10520,7 @@ fn readU32Be() u32 {}
1051410520 <pre>{#syntax#}error{#endsyntax#}</pre>
1051510521 </td>
1051610522 <td>
10517 {#syntax#}error{#endsyntax#} defines an anonymous error type.
10523 {#syntax#}error{#endsyntax#} defines an error type.
1051810524 <ul>
1051910525 <li>See also {#link|Errors#}</li>
1052010526 </ul>
......@@ -10525,7 +10531,8 @@ fn readU32Be() u32 {}
1052510531 <pre>{#syntax#}export{#endsyntax#}</pre>
1052610532 </td>
1052710533 <td>
10528 {#syntax#}export{#endsyntax#} makes a function externally visible in the generated object file, and makes it use the C ABI.
10534 {#syntax#}export{#endsyntax#} makes a function or variable externally visible in the generated object file.
10535 Exported functions default to the C calling convention.
1052910536 <ul>
1053010537 <li>See also {#link|Functions#}</li>
1053110538 </ul>
......@@ -10536,7 +10543,8 @@ fn readU32Be() u32 {}
1053610543 <pre>{#syntax#}extern{#endsyntax#}</pre>
1053710544 </td>
1053810545 <td>
10539 {#syntax#}extern{#endsyntax#} can be used to declare a function that will be resolved at link time, when linking statically, or at runtime, when linking dynamically.
10546 {#syntax#}extern{#endsyntax#} can be used to declare a function or variable that will be resolved at link time, when linking statically
10547 or at runtime, when linking dynamically.
1054010548 <ul>
1054110549 <li>See also {#link|Functions#}</li>
1054210550 </ul>
......@@ -10569,7 +10577,7 @@ fn readU32Be() u32 {}
1056910577 <pre>{#syntax#}for{#endsyntax#}</pre>
1057010578 </td>
1057110579 <td>
10572 A {#syntax#}for{#endsyntax#} expression can be used to iterate over the elements of a slice or array.
10580 A {#syntax#}for{#endsyntax#} expression can be used to iterate over the elements of a slice, array, or tuple.
1057310581 <ul>
1057410582 <li>See also {#link|for#}</li>
1057510583 </ul>
......@@ -10648,7 +10656,7 @@ fn readU32Be() u32 {}
1064810656 <pre>{#syntax#}orelse{#endsyntax#}</pre>
1064910657 </td>
1065010658 <td>
10651 {#syntax#}orelse{#endsyntax#} can be used to provide a default value for an optional expression if it evaluates to null.
10659 {#syntax#}orelse{#endsyntax#} can be used to evaluate an expression if the expression before it evaluates to null.
1065210660 <ul>
1065310661 <li>See also {#link|Optionals#}, {#link|Operators#}</li>
1065410662 </ul>
......@@ -10659,7 +10667,8 @@ fn readU32Be() u32 {}
1065910667 <pre>{#syntax#}packed{#endsyntax#}</pre>
1066010668 </td>
1066110669 <td>
10662 The {#syntax#}packed{#endsyntax#} keyword before a struct definition changes the struct's in-memory layout to the guaranteed {#syntax#}packed{#endsyntax#} layout.
10670 The {#syntax#}packed{#endsyntax#} keyword before a struct definition changes the struct's in-memory layout
10671 to the guaranteed {#syntax#}packed{#endsyntax#} layout.
1066310672 <ul>
1066410673 <li>See also {#link|packed struct#}</li>
1066510674 </ul>
......@@ -10670,7 +10679,8 @@ fn readU32Be() u32 {}
1067010679 <pre>{#syntax#}pub{#endsyntax#}</pre>
1067110680 </td>
1067210681 <td>
10673 The {#syntax#}pub{#endsyntax#} in front of a top level declaration makes the declaration available to reference from a different file than the one it is declared in.
10682 The {#syntax#}pub{#endsyntax#} in front of a top level declaration makes the declaration available
10683 to reference from a different file than the one it is declared in.
1067410684 <ul>
1067510685 <li>See also {#link|import#}</li>
1067610686 </ul>
......@@ -10714,7 +10724,7 @@ fn readU32Be() u32 {}
1071410724 <pre>{#syntax#}struct{#endsyntax#}</pre>
1071510725 </td>
1071610726 <td>
10717 {#syntax#}struct{#endsyntax#} defines an anonymous struct.
10727 {#syntax#}struct{#endsyntax#} defines a struct.
1071810728 <ul>
1071910729 <li>See also {#link|struct#}</li>
1072010730 </ul>
......@@ -10726,7 +10736,8 @@ fn readU32Be() u32 {}
1072610736 </td>
1072710737 <td>
1072810738 {#syntax#}suspend{#endsyntax#} will cause control flow to return to the call site or resumer of the function.
10729 {#syntax#}suspend{#endsyntax#} can also be used before a block within a function, to allow the function access to it's frame before control flow returns to the call site.
10739 {#syntax#}suspend{#endsyntax#} can also be used before a block within a function,
10740 to allow the function access to its frame before control flow returns to the call site.
1073010741 <ul>
1073110742 <li>See also {#link|Suspend and Resume#}</li>
1073210743 </ul>
......@@ -10737,7 +10748,8 @@ fn readU32Be() u32 {}
1073710748 <pre>{#syntax#}switch{#endsyntax#}</pre>
1073810749 </td>
1073910750 <td>
10740 A {#syntax#}switch{#endsyntax#} expression can be used to test values of a common type. {#syntax#}switch{#endsyntax#} cases can capture field values of a {#link|Tagged union#}.
10751 A {#syntax#}switch{#endsyntax#} expression can be used to test values of a common type.
10752 {#syntax#}switch{#endsyntax#} cases can capture field values of a {#link|Tagged union#}.
1074110753 <ul>
1074210754 <li>See also {#link|switch#}</li>
1074310755 </ul>
......@@ -10748,7 +10760,8 @@ fn readU32Be() u32 {}
1074810760 <pre>{#syntax#}test{#endsyntax#}</pre>
1074910761 </td>
1075010762 <td>
10751 The {#syntax#}test{#endsyntax#} keyword can be used to denote a top-level block of code used to make sure behavior meets expectations.
10763 The {#syntax#}test{#endsyntax#} keyword can be used to denote a top-level block of code
10764 used to make sure behavior meets expectations.
1075210765 <ul>
1075310766 <li>See also {#link|Zig Test#}</li>
1075410767 </ul>
......@@ -10805,7 +10818,7 @@ fn readU32Be() u32 {}
1080510818 <pre>{#syntax#}union{#endsyntax#}</pre>
1080610819 </td>
1080710820 <td>
10808 {#syntax#}union{#endsyntax#} defines an anonymous union.
10821 {#syntax#}union{#endsyntax#} defines a union.
1080910822 <ul>
1081010823 <li>See also {#link|union#}</li>
1081110824 </ul>
......@@ -10816,6 +10829,7 @@ fn readU32Be() u32 {}
1081610829 <pre>{#syntax#}unreachable{#endsyntax#}</pre>
1081710830 </td>
1081810831 <td>
10832 {#syntax#}unreachable{#endsyntax#} can be used to assert that control flow will never happen upon a particular location.
1081910833 Depending on the build mode, {#syntax#}unreachable{#endsyntax#} may emit a panic.
1082010834 <ul>
1082110835 <li>Emits a panic in {#syntax#}Debug{#endsyntax#} and {#syntax#}ReleaseSafe{#endsyntax#} mode, or when using <code>zig test</code>.</li>
......@@ -10829,7 +10843,8 @@ fn readU32Be() u32 {}
1082910843 <pre>{#syntax#}usingnamespace{#endsyntax#}</pre>
1083010844 </td>
1083110845 <td>
10832 {#syntax#}usingnamespace{#endsyntax#} is a top-level declaration that imports all the public declarations of the operand, which must be a struct, union, or enum, into the current scope.
10846 {#syntax#}usingnamespace{#endsyntax#} is a top-level declaration that imports all the public declarations of the operand,
10847 which must be a struct, union, or enum, into the current scope.
1083310848 <ul>
1083410849 <li>See also {#link|usingnamespace#}</li>
1083510850 </ul>
......@@ -10863,7 +10878,8 @@ fn readU32Be() u32 {}
1086310878 <pre>{#syntax#}while{#endsyntax#}</pre>
1086410879 </td>
1086510880 <td>
10866 A {#syntax#}while{#endsyntax#} expression can be used to repeatedly test a boolean, optional, or error union expression, and cease looping when that expression evaluates to false, null, or an error, respectively.
10881 A {#syntax#}while{#endsyntax#} expression can be used to repeatedly test a boolean, optional, or error union expression,
10882 and cease looping when that expression evaluates to false, null, or an error, respectively.
1086710883 <ul>
1086810884 <li>See also {#link|while#}</li>
1086910885 </ul>