diff --git a/moonscript/parse.lua b/moonscript/parse.lua index 2775afe..ac00549 100644 --- a/moonscript/parse.lua +++ b/moonscript/parse.lua @@ -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), diff --git a/todo b/todo index 4156bb2..532cd75 100644 --- a/todo +++ b/todo @@ -46,3 +46,7 @@ or double_args = (...) -> [x * 2 for x in *{...}] + +still some issues with whitespace at end of line + +