From 538005b7dcba31408ecc5087d20fe87309eb6582 Mon Sep 17 00:00:00 2001 From: zhangxun <1958638841@qq.com> Date: Wed, 6 Aug 2025 09:47:54 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=20Demo22=EF=BC=88?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E9=87=8D=E8=BD=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .run/Demo22.run.xml | 10 +++++++ playground/Demo/Demo22/Main.snow | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .run/Demo22.run.xml create mode 100644 playground/Demo/Demo22/Main.snow 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