diff --git a/playground/BugFarm/Bug3/Main.snow b/playground/BugFarm/Bug3/Main.snow new file mode 100644 index 0000000..1e467bd --- /dev/null +++ b/playground/BugFarm/Bug3/Main.snow @@ -0,0 +1,19 @@ +module: Main + import: os + function: main + return_type: void + body: + // 合法 + declare b1: byte = 127b + declare s1: short = 32767s + declare i1: int = 2147483647 + declare l1: long = 9223372036854775807L + + // 溢出(都应该收集到错误) + declare b2: byte = 128b + declare s2: short = 40000s + declare i2: int = 3000000000 + declare l2: long = 9223372036854775808L + end body + end function +end module diff --git a/playground/BugFarm/Bug3/OS.snow b/playground/BugFarm/Bug3/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/BugFarm/Bug3/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