mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
42 lines
429 B
Zig
42 lines
429 B
Zig
pub fn main() void {
|
|
foo(12);
|
|
}
|
|
|
|
fn foo(x: i32) void {
|
|
if (x >= 5) {
|
|
bar();
|
|
} else {
|
|
bang2();
|
|
}
|
|
}
|
|
|
|
fn bar() void {
|
|
if (baz()) {
|
|
quux();
|
|
} else {
|
|
hello();
|
|
}
|
|
}
|
|
|
|
fn baz() bool {
|
|
return bang1();
|
|
}
|
|
|
|
fn quux() void {
|
|
bang2();
|
|
}
|
|
|
|
fn hello() void {
|
|
bang2();
|
|
}
|
|
|
|
fn bang1() bool {
|
|
return false;
|
|
}
|
|
|
|
fn bang2() void {
|
|
@panic("PermissionDenied");
|
|
}
|
|
|
|
// exe=fail
|