forked from ground/ground
Type rework, start struct work
This commit is contained in:
29
tests/struct.grnd
Normal file
29
tests/struct.grnd
Normal file
@@ -0,0 +1,29 @@
|
||||
struct -point
|
||||
init &xpos -int
|
||||
init &ypos -int
|
||||
|
||||
fun -void !init -int &x -int &y
|
||||
set &xpos $x
|
||||
set &ypos $y
|
||||
return
|
||||
endfun
|
||||
|
||||
fun -string !toString
|
||||
# do stuff
|
||||
return "placeholder"
|
||||
endfun
|
||||
|
||||
fun -int !dingle
|
||||
return 23
|
||||
endfun
|
||||
endstruct
|
||||
|
||||
pusharg 43 32
|
||||
init &myPoint -point
|
||||
|
||||
set &myPoint.xpos 17
|
||||
set &myPoint.ypos 23
|
||||
|
||||
!myPoint.dingle &out
|
||||
|
||||
println $myPoint
|
||||
Reference in New Issue
Block a user