summary refs log tree commit diff stats
path: root/compiler/parser.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser.nim')
-rw-r--r--compiler/parser.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 7973f7d37..52466d9fa 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -2393,6 +2393,10 @@ proc parseAll(p: var Parser): PNode =
     if p.tok.indent != 0:
       parMessage(p, errInvalidIndentation)
 
+proc checkFirstLineIndentation*(p: var Parser) =
+  if p.tok.indent != 0 and p.tok.strongSpaceA > 0:
+    parMessage(p, errInvalidIndentation)
+
 proc parseTopLevelStmt(p: var Parser): PNode =
   ## Implements an iterator which, when called repeatedly, returns the next
   ## top-level statement or emptyNode if end of stream.