From 83b2122bd7da0c8526666d74726b73ebca410200 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 28 Jul 2025 17:35:38 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=20Demo16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/Demo/Demo16/Main.snow | 22 ++++++++++++++++++++++ playground/Demo/Demo16/OS.snow | 11 +++++++++++ 2 files changed, 33 insertions(+) create mode 100644 playground/Demo/Demo16/Main.snow create mode 100644 playground/Demo/Demo16/OS.snow diff --git a/playground/Demo/Demo16/Main.snow b/playground/Demo/Demo16/Main.snow new file mode 100644 index 0000000..0211f2d --- /dev/null +++ b/playground/Demo/Demo16/Main.snow @@ -0,0 +1,22 @@ +module: Main + import: os + function: main + return_type: int + body: + loop: + init: + declare i:int = 1 + cond: + i <= 10 + step: + i = i + 1 + body: + if i % 2 == 0 then + print(i) + end if + end body + end loop + return 0 + end body + end function +end module diff --git a/playground/Demo/Demo16/OS.snow b/playground/Demo/Demo16/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/Demo/Demo16/OS.snow @@ -0,0 +1,11 @@ +module: os + import: os + function: print + parameter: + declare i1: int + return_type: void + body: + syscall("PRINT",i1) + end body + end function +end module \ No newline at end of file