mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
permit comments after line decorators and blocks
This commit is contained in:
parent
f1ec1ae321
commit
13747aa955
@ -245,14 +245,14 @@ local build_grammar = wrap(function()
|
||||
Line = Cmt(Indent, check_indent) * Statement + Space * #Break,
|
||||
|
||||
Statement = (Import + While + With + For + ForEach + Return
|
||||
+ ClassDecl + Export + BreakLoop + Ct(ExpList) / flatten_or_mark"explist" * Space) * (
|
||||
+ ClassDecl + Export + BreakLoop + Ct(ExpList) / flatten_or_mark"explist" * Space) * ((
|
||||
-- statement decorators
|
||||
key"if" * Exp * (key"else" * Exp)^-1 * Space / mark"if" +
|
||||
CompInner / mark"comprehension"
|
||||
)^-1 / wrap_decorator,
|
||||
) * Space)^-1 / wrap_decorator,
|
||||
|
||||
EmptyLine = Space * Break,
|
||||
Body = Break * EmptyLine^0 * InBlock + Ct(Statement),
|
||||
Body = Space^-1 * Break * EmptyLine^0 * InBlock + Ct(Statement),
|
||||
|
||||
InBlock = #Cmt(Indent, advance_indent) * Block * OutBlock,
|
||||
OutBlock = Cmt("", pop_indent),
|
||||
|
Loading…
Reference in New Issue
Block a user