test: 增加 Demo 24
This commit is contained in:
parent
ac0d3b9785
commit
71cbb3a737
23
playground/Demo/Demo24/Main.snow
Normal file
23
playground/Demo/Demo24/Main.snow
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
module: Main
|
||||||
|
import: ModuleA,os
|
||||||
|
function: main
|
||||||
|
returns: void
|
||||||
|
body:
|
||||||
|
declare a: int = ModuleA.sum(1,2)
|
||||||
|
end body
|
||||||
|
end function
|
||||||
|
end module
|
||||||
|
|
||||||
|
module: ModuleA
|
||||||
|
globals:
|
||||||
|
declare a: int = 10
|
||||||
|
function: sum
|
||||||
|
params:
|
||||||
|
declare a: int
|
||||||
|
declare b: int
|
||||||
|
returns: int
|
||||||
|
body:
|
||||||
|
return a + b
|
||||||
|
end body
|
||||||
|
end function
|
||||||
|
end module
|
||||||
Loading…
x
Reference in New Issue
Block a user