moonscript/tests/outputs/syntax.lua

59 lines
1.5 KiB
Lua
Raw Normal View History

2011-05-21 22:26:46 +00:00
local x = function() print(what) end
function() end
function() function() function() end end end
go(to(the(barn)))
open(function() the(function() door end) end)
open(function()
the(door)
local hello = function() my(func) end
end)
local h = function() hi end
eat(function() end, world)
local a = 1 + 2 * 3 / 6
2011-05-22 05:00:31 +00:00
a = another
local bunch, go, here = world
2011-05-22 07:58:17 +00:00
func(arg1, arg2, another, arg3)
2011-05-22 05:00:31 +00:00
here = function() end
local we = yeah
2011-05-21 22:26:46 +00:00
local the, different = function() approach end, yeah
dad()
dad(lord)
hello(one, two)();
2011-05-21 22:26:46 +00:00
(5 + 5)(world)
fun(a)(b)
fun(a)(b)
fun(a)(b, bad(hello))
hello(world(what(are(you(doing(here))))))
what(the)[3243](world, yeck(heck))
hairy[hands][are](gross)(okay(okay[world]));
(get[something] + 5)[years]
local i = 200
x = 300
local yeah = (1 + 5) * 3
yeah = ((1 + 5) * 3) / 2
yeah = ((1 + 5) * 3) / 2 + i % 100
local whoa = (1 + 2) * (3 + 4) * (4 + 5);
(function() end)()
return(5 + function() 4 + 2 end)
return(5 + (function() 4 end) + 2)
print(5 + function()
34
good(nads)
2011-05-23 02:28:25 +00:00
end)
something('else', "ya")
something('else')
something("else")
2011-05-24 06:58:10 +00:00
here(we)("go")[12123]
local something = { test = 12323, what = function() print("hello world") end }
print(something.test)
local frick = { hello = "world" }
local argon = { num = 100, world = function(self)
print(self.num)
return({ something = function() print("hi from something") end })
end, somethin = function(self,str)
print("string is", str)
return({ world = function(a,b) print("sum", a + b) end })
end }
something.what()
argon:world().something()
argon:somethin("200").world(1, 2)