Skip to content

Commit 6925dee

Browse files
committed
fixed parse error for comment at end of file
1 parent c344b8c commit 6925dee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

moonscript/parse.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ local build_grammar = wrap(function()
267267
File = Shebang^-1 * (Block + Ct""),
268268
Block = Ct(Line * (Break^1 * Line)^0),
269269
CheckIndent = Cmt(Indent, check_indent), -- validates line is in correct indent
270-
Line = CheckIndent * Statement + Space * #Break,
270+
Line = (CheckIndent * Statement + Space * #Stop),
271271

272272
Statement = (Import + While + With + For + ForEach + Return
273273
+ ClassDecl + Export + BreakLoop + Ct(ExpList) / flatten_or_mark"explist" * Space) * ((

tests/inputs/syntax.moon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ y = ifsomething
192192
z = x and b
193193
z = x andb
194194

195-
195+
-- cooool

0 commit comments

Comments
 (0)