1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

native: implement for-c and for-in range loops (#12155)

This commit is contained in:
pancake
2021-11-30 10:49:30 +01:00
committed by GitHub
parent 05db3533d3
commit 1b691e7612
6 changed files with 262 additions and 62 deletions

View File

@ -1,20 +1,18 @@
// fn println(s string) { }
// fn test_fn() {
// println('test fn')
//}
fn test_fn() {
println('test fn')
}
fn main() {
println('native test')
// i := 0
// for i < 5 {
for _ in 1 .. 5 {
println('Hello world from V native machine code generator!')
// i++
mut i := 0
for i < 5 {
println('Hello world from V native machine code generator, in a while style for loop!')
i++
}
for _ in 1 .. 5 {
println('Hello world from V native machine code generator, in a range loop!')
}
/*
println('Hello again!')
//test_fn()
test_fn()
println('done')
*/
}