Simplified compilation of function calls
This commit is contained in:
11
tests/programs/function-pointer-field.q
Normal file
11
tests/programs/function-pointer-field.q
Normal file
@ -0,0 +1,11 @@
|
||||
import core
|
||||
|
||||
struct Struct {
|
||||
func *any
|
||||
}
|
||||
|
||||
main() {
|
||||
s := new(Struct)
|
||||
s.func = core.exit
|
||||
s.func()
|
||||
}
|
21
tests/programs/loop-in-loop.q
Normal file
21
tests/programs/loop-in-loop.q
Normal file
@ -0,0 +1,21 @@
|
||||
import sys
|
||||
|
||||
main() {
|
||||
x := 0
|
||||
|
||||
loop {
|
||||
for 0..10 {
|
||||
x += 1
|
||||
}
|
||||
|
||||
assert x == 10
|
||||
|
||||
loop {
|
||||
x -= 1
|
||||
|
||||
if x == 0 {
|
||||
sys.exit(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user