mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
Allow real statements inside of class
This commit is contained in:
parent
5e7520e491
commit
8cf92a3591
@ -501,7 +501,7 @@ local build_grammar = wrap_env(function()
|
|||||||
Ct(ClassLine * (SpaceBreak^1 * ClassLine)^0) * PopIndent,
|
Ct(ClassLine * (SpaceBreak^1 * ClassLine)^0) * PopIndent,
|
||||||
ClassLine = CheckIndent * ((
|
ClassLine = CheckIndent * ((
|
||||||
KeyValueList / mark"props" +
|
KeyValueList / mark"props" +
|
||||||
(Assign + Update) / mark"stm" +
|
Statement / mark"stm" +
|
||||||
Exp / mark"stm"
|
Exp / mark"stm"
|
||||||
) * sym","^-1),
|
) * sym","^-1),
|
||||||
|
|
||||||
|
@ -540,7 +540,6 @@ local self = self + self / self
|
|||||||
self = 343
|
self = 343
|
||||||
self.hello(2, 3, 4)
|
self.hello(2, 3, 4)
|
||||||
local _ = hello[self].world
|
local _ = hello[self].world
|
||||||
if something then
|
|
||||||
local Whacko
|
local Whacko
|
||||||
Whacko = (function()
|
Whacko = (function()
|
||||||
local hello
|
local hello
|
||||||
@ -582,11 +581,12 @@ if something then
|
|||||||
end
|
end
|
||||||
hello = "world"
|
hello = "world"
|
||||||
self.another = "day"
|
self.another = "day"
|
||||||
|
if something then
|
||||||
print("yeah")
|
print("yeah")
|
||||||
|
end
|
||||||
if _parent_0 and _parent_0.__inherited then
|
if _parent_0 and _parent_0.__inherited then
|
||||||
_parent_0.__inherited(_parent_0, _class_0)
|
_parent_0.__inherited(_parent_0, _class_0)
|
||||||
end
|
end
|
||||||
return _class_0
|
return _class_0
|
||||||
end)()
|
end)()
|
||||||
end
|
|
||||||
print("hello")
|
print("hello")
|
Loading…
Reference in New Issue
Block a user