implemented labels and goto parsing
This commit is contained in:
parent
1be3bf0659
commit
1ca6f024ee
7 changed files with 71 additions and 17 deletions
21
examples/for.l
Normal file
21
examples/for.l
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import std::io;
|
||||
|
||||
i32 main()
|
||||
{
|
||||
[u32] list = [1, 2, 3, 4, 5];
|
||||
|
||||
// iterative loop
|
||||
loop (0.., list) |i, v| {
|
||||
printf("%d\n", i);
|
||||
}
|
||||
|
||||
// conditional loop
|
||||
loop a == 3 {
|
||||
|
||||
}
|
||||
|
||||
// infinite loop
|
||||
loop {
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue