mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
fixed whitespace/comment parse issues
This commit is contained in:
parent
44b5517a54
commit
05c891a28f
@ -242,7 +242,7 @@ local build_grammar = wrap(function()
|
|||||||
File,
|
File,
|
||||||
File = Block + Ct"",
|
File = Block + Ct"",
|
||||||
Block = Ct(Line * (Break^1 * Line)^0),
|
Block = Ct(Line * (Break^1 * Line)^0),
|
||||||
Line = Cmt(Indent, check_indent) * Statement + _Space * Comment,
|
Line = Cmt(Indent, check_indent) * Statement + Space * #Break,
|
||||||
|
|
||||||
Statement = (Import + While + With + For + ForEach + Return
|
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) * (
|
||||||
@ -251,7 +251,8 @@ local build_grammar = wrap(function()
|
|||||||
CompInner / mark"comprehension"
|
CompInner / mark"comprehension"
|
||||||
)^-1 / wrap_decorator,
|
)^-1 / wrap_decorator,
|
||||||
|
|
||||||
Body = Break * InBlock + Ct(Statement),
|
EmptyLine = Space * Break,
|
||||||
|
Body = Break * EmptyLine^0 * InBlock + Ct(Statement),
|
||||||
|
|
||||||
InBlock = #Cmt(Indent, advance_indent) * Block * OutBlock,
|
InBlock = #Cmt(Indent, advance_indent) * Block * OutBlock,
|
||||||
OutBlock = Cmt("", pop_indent),
|
OutBlock = Cmt("", pop_indent),
|
||||||
|
1
todo
1
todo
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
- class expressions, x = class extends Hello do new: => print "hello"
|
- class expressions, x = class extends Hello do new: => print "hello"
|
||||||
|
|
||||||
* issues with whitespace on the end of lines
|
|
||||||
* multiline comments
|
* multiline comments
|
||||||
* table slices (almost)
|
* table slices (almost)
|
||||||
* add continue keyword (ouch)
|
* add continue keyword (ouch)
|
||||||
|
Loading…
Reference in New Issue
Block a user