diff --git a/.run/Demo22.run.xml b/.run/Demo22.run.xml new file mode 100644 index 0000000..67c1bf6 --- /dev/null +++ b/.run/Demo22.run.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/playground/Demo/Demo22/Main.snow b/playground/Demo/Demo22/Main.snow new file mode 100644 index 0000000..bfcfac4 --- /dev/null +++ b/playground/Demo/Demo22/Main.snow @@ -0,0 +1,46 @@ +module: Main + import: os + function: main + params: + returns: int + body: + declare x: int = 0 + + x = inc(x, 1) + println(x) + + x = inc(x, 7) + println(x) + + return 0 + end body + end function + + function: inc + params: + declare num: int + returns: int + body: + return num + 1 + end body + end function + + function: inc + params: + declare num: int + declare v: int + returns: int + body: + return num + v + end body + end function + + function: println + params: + declare i1: int + returns: void + body: + os.syscall("PRINTLN",i1) + end body + end function +end module