From 63e8b0163ad11f267c289e367d78702e10f474a8 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 28 Jul 2025 18:01:06 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=20Demo17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/Demo/Demo17/Main.snow | 23 +++++++++++++++++++++++ playground/Demo/Demo17/OS.snow | 11 +++++++++++ 2 files changed, 34 insertions(+) create mode 100644 playground/Demo/Demo17/Main.snow create mode 100644 playground/Demo/Demo17/OS.snow diff --git a/playground/Demo/Demo17/Main.snow b/playground/Demo/Demo17/Main.snow new file mode 100644 index 0000000..6171781 --- /dev/null +++ b/playground/Demo/Demo17/Main.snow @@ -0,0 +1,23 @@ +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) + break + end if + end body + end loop + return 0 + end body + end function +end module diff --git a/playground/Demo/Demo17/OS.snow b/playground/Demo/Demo17/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/Demo/Demo17/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