diff --git a/playground/BugFarm/Bug2/Main.snow b/playground/BugFarm/Bug2/Main.snow new file mode 100644 index 0000000..ca1d0c8 --- /dev/null +++ b/playground/BugFarm/Bug2/Main.snow @@ -0,0 +1,45 @@ +module: Main + import: os + function: main + parameter: + return_type: int + body: + loop: + init: + declare outer_i: int = 1 + cond: + outer_i <= 10 + step: + outer_i = outer_i + 1 + body: + print(outer_i) + + loop: + init: + // 注意这一行使用了外层循环的变量 outer_i + declare inter_j: int = outer_i + cond: + inter_j <= 10 + step: + inter_j = inter_j + 1 + body: + + end body + end loop + + end body + end loop + + return 0 + end body + end function + + 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 diff --git a/playground/BugFarm/Bug2/OS.snow b/playground/BugFarm/Bug2/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/BugFarm/Bug2/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