permit comments after line decorators and blocks

This commit is contained in:
leaf corcoran 2011-07-30 01:32:58 -07:00
parent f1ec1ae321
commit 13747aa955
2 changed files with 7 additions and 3 deletions

View File

@ -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),

4
todo
View File

@ -46,3 +46,7 @@ or
double_args = (...) ->
[x * 2 for x in *{...}]
still some issues with whitespace at end of line