mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
Add a for statement variant for the case of a "for" with an init, no condition and no post-increment. Fixes #933.
17 lines
174 B
Go
17 lines
174 B
Go
package main
|
|
|
|
func f() int { println("in f"); return 1 }
|
|
|
|
func main() {
|
|
for i := f(); ; {
|
|
println("in loop")
|
|
if i > 0 {
|
|
break
|
|
}
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// in f
|
|
// in loop
|