mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 18:16:31 +00:00
language specification
This commit is contained in:
parent
584220e96b
commit
25df78fd85
30
example.slg
Normal file
30
example.slg
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
fn add(a: int, b: int) -> int {
|
||||
a + b
|
||||
}
|
||||
|
||||
add(2,3); // -> 5
|
||||
|
||||
let a: string = "Hello";
|
||||
|
||||
let b = "world";
|
||||
|
||||
println(a + " " + b + "!"); // -> "Hello world!"
|
||||
|
||||
if a == b {
|
||||
println("whaaaat");
|
||||
}
|
||||
else {
|
||||
println(":o");
|
||||
}
|
||||
|
||||
loop {
|
||||
let i = 0;
|
||||
|
||||
if i >= 10 {
|
||||
break;
|
||||
}
|
||||
|
||||
i += 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user