let class be the key in an unbound table

This commit is contained in:
leaf corcoran 2012-11-10 22:09:36 -08:00
parent f11eb0d250
commit 48662adc3b
3 changed files with 6 additions and 1 deletions

View File

@ -552,7 +552,7 @@ local build_grammar = wrap_env(function()
TableBlockInner = Ct(KeyValueLine * (SpaceBreak^1 * KeyValueLine)^0), TableBlockInner = Ct(KeyValueLine * (SpaceBreak^1 * KeyValueLine)^0),
TableBlock = SpaceBreak^1 * Advance * ensure(TableBlockInner, PopIndent) / mark"table", 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 * ClassBlock = SpaceBreak^1 * Advance *
Ct(ClassLine * (SpaceBreak^1 * ClassLine)^0) * PopIndent, Ct(ClassLine * (SpaceBreak^1 * ClassLine)^0) * PopIndent,

View File

@ -157,6 +157,8 @@ hello =
good: 230203 good: 230203
div class: "cool"
5 + what wack 5 + what wack
what whack + 5 what whack + 5

View File

@ -168,6 +168,9 @@ hello = {
["function"] = "okay", ["function"] = "okay",
good = 230203 good = 230203
} }
div({
class = "cool"
})
_ = 5 + what(wack) _ = 5 + what(wack)
what(whack + 5) what(whack + 5)
_ = 5 - what(wack) _ = 5 - what(wack)