more continious examples

main
Øyvind Skaaden 2022-04-02 20:15:06 +02:00
parent 3d68d7227c
commit 63a5efae3c
6 changed files with 87 additions and 2 deletions

View File

@ -0,0 +1,9 @@
func add(a, b) begin
return a + b
end
func main()
begin
print add(40, 2)
return 0
end

View File

@ -0,0 +1,12 @@
var global_var0, global_var1
func my_func(param0, param1) begin
var a
return 0
end
func main() begin
var a
print "a string"
return 0
end

View File

@ -0,0 +1,28 @@
// Checking symbol shadowing
var a
func shadow() begin
var a, b
a := 1
begin
var a
a := 2
b := 40
begin
var a
a := b + 2
print a, b
end
print a
begin
var b
b := 38
a := b + 3
print a, b
end
print a
end
print b
return 0
end

View File

@ -0,0 +1,18 @@
func my_func(a, b, c, d, e, f, g, h) begin
var i, j, k, l, m
i := a + b + d
if i = f then begin
print "hmmm"
end
return i
end
func main() begin
var n, o, p, q, r, s, t, u, v, w
n := 5
n += my_func(1, 2, 3, 5, 8, 13, 21, 34)
return 0
end

View File

@ -1,9 +1,9 @@
func add(a, b) begin
func add(a, b, c) begin
return a + b
end
func main()
begin
print add(40, 2)
print add(40, 2, 4)
return 0
end

View File

@ -0,0 +1,18 @@
func my_func(a, b, c, d, e, f, g, h) begin
var i, j, k, l, m
i := a + b + d
if i = f then begin
print "hmmm"
end
return i
end
func main() begin
var n, o, p, q, r, s, t, u, v, w
n := 5
n += my_func(1, 2, 3, 5, 8, 13, 21, 34)
return 0
end