summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-10-01 20:24:37 +0200
committerAraq <rumpf_a@web.de>2013-10-01 20:24:37 +0200
commita943905d6cb705d5e5ab18e96c880aa7b42128a1 (patch)
treef746014d3f1c22d965fa1b710eeda476fdbbbe83 /compiler
parentf857a842fce160fa89161ba532e19f90e37c5711 (diff)
downloadNim-a943905d6cb705d5e5ab18e96c880aa7b42128a1.tar.gz
fixes #609
Diffstat (limited to 'compiler')
-rw-r--r--compiler/parser.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 6e2d0867b..1411043e4 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -1798,7 +1798,10 @@ proc parseStmt(p: var TParser): PNode =
         if p.tok.indent == p.currInd:
           nil
         elif p.tok.tokType == tkSemicolon:
-          while p.tok.tokType == tkSemicolon: getTok(p)
+          while p.tok.tokType == tkSemicolon:
+            getTok(p)
+            if p.tok.indent < 0 or p.tok.indent == p.currInd: discard
+            else: return
         else:
           if p.tok.indent > p.currInd:
             parMessage(p, errInvalidIndentation)
@@ -1851,7 +1854,10 @@ proc parseTopLevelStmt(p: var TParser): PNode =
       else: parMessage(p, errInvalidIndentation)
     p.firstTok = false
     case p.tok.tokType
-    of tkSemicolon: getTok(p)
+    of tkSemicolon:
+      getTok(p)
+      if p.tok.indent <= 0: discard
+      else: parMessage(p, errInvalidIndentation)
     of tkEof: break
     else:
       result = complexOrSimpleStmt(p)