From 43aa055d7d193aaaaaab3bc2dfe77ef767b510ee Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 10 Jul 2025 11:34:31 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=20Demo12=20=E4=B8=BB?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新建 Main.snow 文件,实现了一个简单的主程序 - 包含两个函数:main 和 foo - main函数中调用了 foo 函数- foo 函数中包含一个无效的 if 语句,始终返回 0 --- playground/Demo12/Main.snow | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 playground/Demo12/Main.snow diff --git a/playground/Demo12/Main.snow b/playground/Demo12/Main.snow new file mode 100644 index 0000000..134096c --- /dev/null +++ b/playground/Demo12/Main.snow @@ -0,0 +1,21 @@ +module: Main + function: main + return_type: int + body: + foo() + + return 0 + end body + end function + + function: foo + return_type: int + body: + if false then + return 1 + end if + + return 0 + end body + end function +end module \ No newline at end of file