mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
let class
be the key in an unbound table
This commit is contained in:
parent
f11eb0d250
commit
48662adc3b
@ -552,7 +552,7 @@ local build_grammar = wrap_env(function()
|
||||
TableBlockInner = Ct(KeyValueLine * (SpaceBreak^1 * KeyValueLine)^0),
|
||||
TableBlock = SpaceBreak^1 * Advance * ensure(TableBlockInner, PopIndent) / mark"table",
|
||||
|
||||
ClassDecl = key"class" * (Assignable + Cc(nil)) * (key"extends" * PreventIndent * ensure(Exp, PopIndent) + C"")^-1 * (ClassBlock + Ct("")) / mark"class",
|
||||
ClassDecl = key"class" * -P":" * (Assignable + Cc(nil)) * (key"extends" * PreventIndent * ensure(Exp, PopIndent) + C"")^-1 * (ClassBlock + Ct("")) / mark"class",
|
||||
|
||||
ClassBlock = SpaceBreak^1 * Advance *
|
||||
Ct(ClassLine * (SpaceBreak^1 * ClassLine)^0) * PopIndent,
|
||||
|
@ -157,6 +157,8 @@ hello =
|
||||
good: 230203
|
||||
|
||||
|
||||
div class: "cool"
|
||||
|
||||
5 + what wack
|
||||
what whack + 5
|
||||
|
||||
|
@ -168,6 +168,9 @@ hello = {
|
||||
["function"] = "okay",
|
||||
good = 230203
|
||||
}
|
||||
div({
|
||||
class = "cool"
|
||||
})
|
||||
_ = 5 + what(wack)
|
||||
what(whack + 5)
|
||||
_ = 5 - what(wack)
|
||||
|
Loading…
Reference in New Issue
Block a user