mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +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
|