From 028561fc4f002695701cf99b063d368c8571e7ad Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 1 Aug 2025 18:36:06 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=20Demo19=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/Demo/Demo19/Main.snow | 14 ++++++++++++++ playground/Demo/Demo19/OS.snow | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 playground/Demo/Demo19/Main.snow create mode 100644 playground/Demo/Demo19/OS.snow diff --git a/playground/Demo/Demo19/Main.snow b/playground/Demo/Demo19/Main.snow new file mode 100644 index 0000000..046d496 --- /dev/null +++ b/playground/Demo/Demo19/Main.snow @@ -0,0 +1,14 @@ +module: Main + import: os + function: main + return_type: void + body: + declare cols: int = 2 + declare matrix: int[] = [1, 2, 3, 4] + + declare x: int = matrix[cols] + + os.print(x) + end body + end function +end module diff --git a/playground/Demo/Demo19/OS.snow b/playground/Demo/Demo19/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/Demo/Demo19/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