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:
@ -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')
|
||||
*/
|
||||
}
|
||||
|
Reference in New Issue
Block a user