mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 19:42:56 +00:00
Merge 875ae2e361
into f845fa04a0
This commit is contained in:
commit
7405ee3c4b
@ -1564,6 +1564,23 @@ const unwrapped = value catch 1234;
|
|||||||
unwrapped == 1234{#endsyntax#}</pre>
|
unwrapped == 1234{#endsyntax#}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Forwarding Error Unwrap</td>
|
||||||
|
<td><pre>{#syntax#}try a{#endsyntax#}</pre></td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>{#link|Error Unions|Errors#}</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Equivalent to:
|
||||||
|
<pre>{#syntax#}a catch |err| return err{#endsyntax#}</pre>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<pre>{#syntax#}const value: anyerror!u32 = 5678;
|
||||||
|
(try value) == 5678{#endsyntax#}</pre>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Logical And</td>
|
<td>Logical And</td>
|
||||||
<td><pre>{#syntax#}a and b{#endsyntax#}</pre></td>
|
<td><pre>{#syntax#}a and b{#endsyntax#}</pre></td>
|
||||||
@ -1845,7 +1862,7 @@ const B = error{Two};
|
|||||||
<pre>{#syntax#}x() x[] x.y x.* x.?
|
<pre>{#syntax#}x() x[] x.y x.* x.?
|
||||||
a!b
|
a!b
|
||||||
x{}
|
x{}
|
||||||
!x -x -%x ~x &x ?x
|
!x -x -%x ~x &x ?x try
|
||||||
* / % ** *% *| ||
|
* / % ** *% *| ||
|
||||||
+ - ++ +% -% +| -|
|
+ - ++ +% -% +| -|
|
||||||
<< >> <<|
|
<< >> <<|
|
||||||
@ -1853,6 +1870,7 @@ x{}
|
|||||||
== != < > <= >=
|
== != < > <= >=
|
||||||
and
|
and
|
||||||
or
|
or
|
||||||
|
return break continue
|
||||||
= *= *%= *|= /= %= += +%= +|= -= -%= -|= <<= <<|= >>= &= ^= |={#endsyntax#}</pre>
|
= *= *%= *|= /= %= += +%= +|= -= -%= -|= <<= <<|= >>= &= ^= |={#endsyntax#}</pre>
|
||||||
{#header_close#}
|
{#header_close#}
|
||||||
{#header_close#}
|
{#header_close#}
|
||||||
|
Loading…
Reference in New Issue
Block a user