summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-01-17 23:46:23 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-01-17 23:46:23 +0100
commit3114523a6ff0f0d19aeffcb25a21a7f954dc74fa (patch)
treedacc35c9de95c6bca17585208b42acced6e82589 /compiler
parenta9f6e2a843f2152676e1eb7fd043022a2fece114 (diff)
downloadNim-3114523a6ff0f0d19aeffcb25a21a7f954dc74fa.tar.gz
fixes multi-line comments
Diffstat (limited to 'compiler')
-rw-r--r--compiler/lexer.nim13
1 files changed, 10 insertions, 3 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index e51d8db8a..fc43f8d6a 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -913,9 +913,16 @@ proc skip(L: var TLexer, tok: var TToken) =
       pos = handleCRLF(L, pos)
       buf = L.buf
       var indent = 0
-      while buf[pos] == ' ':
-        inc(pos)
-        inc(indent)
+      while true:
+        if buf[pos] == ' ':
+          inc(pos)
+          inc(indent)
+        elif buf[pos] == '#' and buf[pos+1] == '[':
+          skipMultiLineComment(L, tok, pos+2, false)
+          pos = L.bufpos
+          buf = L.buf
+        else:
+          break
       tok.strongSpaceA = 0
       when defined(nimfix):
         template doBreak(): expr = buf[pos] > ' '