From 59e279ba9cd0cedb8021c9f8cd425cb38e128224 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 23 Dec 2014 23:08:37 +0100 Subject: fixes a small bug concerning semicolons for top level statements --- compiler/parser.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/parser.nim') diff --git a/compiler/parser.nim b/compiler/parser.nim index a91760e15..87565ae3a 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1980,15 +1980,17 @@ proc parseTopLevelStmt(p: var TParser): PNode = ## top-level statement or emptyNode if end of stream. result = ast.emptyNode while true: - if p.tok.indent != 0: + if p.tok.indent != 0: if p.firstTok and p.tok.indent < 0: discard - else: parMessage(p, errInvalidIndentation) + elif p.tok.tokType != tkSemiColon: + parMessage(p, errInvalidIndentation) p.firstTok = false case p.tok.tokType of tkSemiColon: getTok(p) if p.tok.indent <= 0: discard else: parMessage(p, errInvalidIndentation) + p.firstTok = true of tkEof: break else: result = complexOrSimpleStmt(p) -- cgit 1.4.1-2-gfad0