mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
25
samples/Terra/incomplete2.t
Normal file
25
samples/Terra/incomplete2.t
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
struct A {
|
||||
b : &B
|
||||
} and
|
||||
struct B
|
||||
|
||||
|
||||
terra foo()
|
||||
var a : A
|
||||
a.b = nil
|
||||
return a
|
||||
end
|
||||
|
||||
local a = foo()
|
||||
|
||||
|
||||
struct B {
|
||||
a : int
|
||||
}
|
||||
|
||||
terra foo2(a : &A)
|
||||
a.b = a.b + 1
|
||||
end
|
||||
|
||||
foo2(a)
|
||||
Reference in New Issue
Block a user