mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-15 22:05:46 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
16
samples/Terra/structrvalue.t
Normal file
16
samples/Terra/structrvalue.t
Normal file
@@ -0,0 +1,16 @@
|
||||
--the zero line
|
||||
struct A { b : B } and
|
||||
struct B {a : int, b : int}
|
||||
|
||||
|
||||
terra foo()
|
||||
var b = B {1,2}
|
||||
return b
|
||||
end
|
||||
|
||||
terra bar()
|
||||
return foo().b
|
||||
end
|
||||
|
||||
local test = require("test")
|
||||
test.eq(bar(),2)
|
||||
Reference in New Issue
Block a user