mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-21 16:55:54 +00:00
samples: add Terra samples
source: https://github.com/zdevito/terra/tree/master/tests
This commit is contained in:
18
samples/Terra/gettype.t
Normal file
18
samples/Terra/gettype.t
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
|
||||
function makestuff(a)
|
||||
local T = a:gettype()
|
||||
local struct ST {
|
||||
a : T
|
||||
}
|
||||
return `ST { a }
|
||||
end
|
||||
|
||||
makestuff = macro(makestuff)
|
||||
|
||||
terra useit()
|
||||
return makestuff(true).a,makestuff(3.0).a
|
||||
end
|
||||
local test = require("test")
|
||||
test.meq({true,3},useit())
|
||||
Reference in New Issue
Block a user