test: 添加 Demo16
This commit is contained in:
parent
9132c79c54
commit
83b2122bd7
22
playground/Demo/Demo16/Main.snow
Normal file
22
playground/Demo/Demo16/Main.snow
Normal file
@ -0,0 +1,22 @@
|
||||
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)
|
||||
end if
|
||||
end body
|
||||
end loop
|
||||
return 0
|
||||
end body
|
||||
end function
|
||||
end module
|
||||
11
playground/Demo/Demo16/OS.snow
Normal file
11
playground/Demo/Demo16/OS.snow
Normal file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user