50 lines
614 B
Plaintext
50 lines
614 B
Plaintext
sum func(a, b int) int {
|
|
return a + b
|
|
}
|
|
|
|
max func(a, b int) int {
|
|
if a > b {
|
|
return a
|
|
}
|
|
return b
|
|
}
|
|
|
|
nested func(value int) int {
|
|
two :: 2
|
|
return sum(value, two)
|
|
}
|
|
|
|
make_array func($N usize) [N]u8 {
|
|
data [N]u8 := undefined
|
|
return data
|
|
}
|
|
|
|
forced :: $sum(1, 2)
|
|
|
|
main func() i32 {
|
|
value i32 :: $sum(20, 22)
|
|
choice i32 :: $max(9, 3)
|
|
blocked i32 :: ${
|
|
local :: 5
|
|
yield sum(local, 6)
|
|
}
|
|
bytes [_]u8 :: make_array($nested(2))
|
|
|
|
if forced != 3 {
|
|
return 1
|
|
}
|
|
if value != 42 {
|
|
return 2
|
|
}
|
|
if choice != 9 {
|
|
return 3
|
|
}
|
|
if blocked != 11 {
|
|
return 4
|
|
}
|
|
if bytes.len != 4 {
|
|
return 5
|
|
}
|
|
return 0
|
|
}
|