authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-03-24 00:00:52+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-07 14:54:53-04:00
logb7f116a774ce64b39ddf9798e135aee76d03f44e
tree1e2873007da2ab4f7f393dbf427a753f5dd1fb97
parent22dbeab29dab9e349122a539acdf7e32561109dd

langref: small updates


1 files changed, 4 insertions(+), 6 deletions(-)

doc/langref.html.in+4-6
...@@ -247,8 +247,7 @@ pub fn main() void {...@@ -247,8 +247,7 @@ pub fn main() void {
247}247}
248 {#code_end#}248 {#code_end#}
249 <p>249 <p>
250 Note that we also left off the {#syntax#}!{#endsyntax#} from the return type.250 Note that you can leave off the {#syntax#}!{#endsyntax#} from the return type because {#syntax#}warn{#endsyntax#} cannot fail.
251 In Zig, if your main function cannot fail, you must use the {#syntax#}void{#endsyntax#} return type.
252 </p>251 </p>
253 {#see_also|Values|@import|Errors|Root Source File#}252 {#see_also|Values|@import|Errors|Root Source File#}
254 {#header_close#}253 {#header_close#}
...@@ -985,7 +984,7 @@ export fn foo_strict(x: f64) f64 {...@@ -985,7 +984,7 @@ export fn foo_strict(x: f64) f64 {
985}984}
986985
987export fn foo_optimized(x: f64) f64 {986export fn foo_optimized(x: f64) f64 {
988 @setFloatMode(builtin.FloatMode.Optimized);987 @setFloatMode(.Optimized);
989 return x + big - big;988 return x + big - big;
990}989}
991 {#code_end#}990 {#code_end#}
...@@ -2992,7 +2991,7 @@ test "simple union" {...@@ -2992,7 +2991,7 @@ test "simple union" {
2992 This turns the union into a <em>tagged</em> union, which makes it eligible2991 This turns the union into a <em>tagged</em> union, which makes it eligible
2993 to use with {#link|switch#} expressions. One can use {#link|@TagType#} to2992 to use with {#link|switch#} expressions. One can use {#link|@TagType#} to
2994 obtain the enum type from the union type.2993 obtain the enum type from the union type.
2995 Tagged unions coerce to their enum {#link|Type Coercion: unions and enums#}2994 Tagged unions coerce to their tag type: {#link|Type Coercion: unions and enums#}.
2996 </p>2995 </p>
2997 {#code_begin|test#}2996 {#code_begin|test#}
2998const std = @import("std");2997const std = @import("std");
...@@ -9479,7 +9478,7 @@ pub fn main() void {...@@ -9479,7 +9478,7 @@ pub fn main() void {
9479const builtin = @import("builtin");9478const builtin = @import("builtin");
94809479
9481const c = @cImport({9480const c = @cImport({
9482 @cDefine("NDEBUG", builtin.mode == builtin.Mode.ReleaseFast);9481 @cDefine("NDEBUG", builtin.mode == .ReleaseFast);
9483 if (something) {9482 if (something) {
9484 @cDefine("_GNU_SOURCE", {});9483 @cDefine("_GNU_SOURCE", {});
9485 }9484 }
...@@ -10077,7 +10076,6 @@ fn readU32Be() u32 {}...@@ -10077,7 +10076,6 @@ fn readU32Be() u32 {}
10077 {#header_open|Keyword: pub#}10076 {#header_open|Keyword: pub#}
10078 <p>The {#syntax#}pub{#endsyntax#} in front of a top level declaration makes the10077 <p>The {#syntax#}pub{#endsyntax#} in front of a top level declaration makes the
10079 declaration available to reference from a different file than the one it is declared in.</p>10078 declaration available to reference from a different file than the one it is declared in.</p>
10080 <p><a href="https://github.com/ziglang/zig/issues/2059">TODO delete pub syntax for fields, or make it do something.</a></p>
10081 {#see_also|@import#}10079 {#see_also|@import#}
10082 {#header_close#}10080 {#header_close#}
10083 {#header_close#}10081 {#header_close#}