From 5f42beaf2a63991d32edb5e5ddad952d4451080e Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 25 Aug 2025 18:00:54 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=20Demo22=20=E6=BC=94?= =?UTF-8?q?=E7=A4=BA=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/Demo/Demo22/Main.snow | 12 ++++++++++++ playground/Demo/Demo22/ModuleA.snow | 11 +++++++++++ playground/Demo/Demo22/OS.snow | 11 +++++++++++ 3 files changed, 34 insertions(+) create mode 100644 playground/Demo/Demo22/Main.snow create mode 100644 playground/Demo/Demo22/ModuleA.snow create mode 100644 playground/Demo/Demo22/OS.snow diff --git a/playground/Demo/Demo22/Main.snow b/playground/Demo/Demo22/Main.snow new file mode 100644 index 0000000..1c727b4 --- /dev/null +++ b/playground/Demo/Demo22/Main.snow @@ -0,0 +1,12 @@ +module: Main + import: os,ModuleA + globals: + declare sum: int = 3 + function: main + returns: void + body: + sum = sum + ModuleA._sum(1, 2) + os.print(sum) + end body + end function +end module diff --git a/playground/Demo/Demo22/ModuleA.snow b/playground/Demo/Demo22/ModuleA.snow new file mode 100644 index 0000000..c5c9a86 --- /dev/null +++ b/playground/Demo/Demo22/ModuleA.snow @@ -0,0 +1,11 @@ +module: ModuleA + function: _sum + params: + declare a: int + declare b: int + returns: int + body: + return a + b + end body + end function +end module \ No newline at end of file diff --git a/playground/Demo/Demo22/OS.snow b/playground/Demo/Demo22/OS.snow new file mode 100644 index 0000000..1982627 --- /dev/null +++ b/playground/Demo/Demo22/OS.snow @@ -0,0 +1,11 @@ +module: os + import: os + function: print + params: + declare i1: int + returns: void + body: + syscall("PRINT",i1) + end body + end function +end module \ No newline at end of file