mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 07:46:32 +00:00
add a few examples
This commit is contained in:
parent
4be4e50b7d
commit
1640915ddb
9
examples/add_fn.slg
Normal file
9
examples/add_fn.slg
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
fn main() {
|
||||
add(1, 2)
|
||||
}
|
||||
|
||||
fn add(a: int, b: int) -> int {
|
||||
+ a b
|
||||
}
|
5
examples/add_int.slg
Normal file
5
examples/add_int.slg
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
fn main() {
|
||||
+ 1 2
|
||||
}
|
||||
|
7
examples/add_let.slg
Normal file
7
examples/add_let.slg
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
fn main() {
|
||||
let a = 5;
|
||||
let b = 3;
|
||||
+ a b
|
||||
}
|
||||
|
3
examples/main.slg
Normal file
3
examples/main.slg
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
Reference in New Issue
Block a user