test: 添加 Demo25 示例项目
This commit is contained in:
parent
caa62b0bfb
commit
5537a448e8
23
playground/Demo/Demo25/Main.snow
Normal file
23
playground/Demo/Demo25/Main.snow
Normal file
@ -0,0 +1,23 @@
|
||||
module: Main
|
||||
import: os,ModuleA
|
||||
globals:
|
||||
declare c: int = 10
|
||||
function: main
|
||||
returns: void
|
||||
body:
|
||||
c = ModuleA.getA()
|
||||
os.print(c)
|
||||
end body
|
||||
end function
|
||||
end module
|
||||
|
||||
module: ModuleA
|
||||
globals:
|
||||
declare a: int = 2
|
||||
function: getA
|
||||
returns: int
|
||||
body:
|
||||
return a
|
||||
end body
|
||||
end function
|
||||
end module
|
||||
11
playground/Demo/Demo25/OS.snow
Normal file
11
playground/Demo/Demo25/OS.snow
Normal file
@ -0,0 +1,11 @@
|
||||
module: os
|
||||
import: os
|
||||
function: print
|
||||
params:
|
||||
declare i1: int
|
||||
returns: void
|
||||
body:
|
||||
syscall("PRINT",i1)
|
||||
end body
|
||||
end function
|
||||
end module
|
||||
Loading…
x
Reference in New Issue
Block a user