summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-05-05 21:08:45 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-05 21:08:45 +0200
commitdfc17e5f8e0652ebc4c693e5a5900a122b85ab95 (patch)
tree22ef4cc316a1859e21f401a7a3c9bca31785333d
parentb7116a28eea13f4fd82b8b22323f2f75c813794f (diff)
downloadNim-dfc17e5f8e0652ebc4c693e5a5900a122b85ab95.tar.gz
make Nimble not crash after the refactoring
-rw-r--r--compiler/lexer.nim3
-rw-r--r--koch.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index 0aeb44ca3..a65587390 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -237,7 +237,8 @@ proc openLexer*(lex: var TLexer, filename: string, inputstream: PLLStream;
   openLexer(lex, filename.fileInfoIdx, inputstream, cache, config)
 
 proc closeLexer*(lex: var TLexer) =
-  inc(lex.config.linesCompiled, lex.lineNumber)
+  if lex.config != nil:
+    inc(lex.config.linesCompiled, lex.lineNumber)
   closeBaseLexer(lex)
 
 proc getLineInfo(L: TLexer): TLineInfo =
diff --git a/koch.nim b/koch.nim
index d51b902ee..7a75ebf71 100644
--- a/koch.nim
+++ b/koch.nim
@@ -252,7 +252,7 @@ proc xz(args: string) =
 
 proc buildTool(toolname, args: string) =
   nimexec("cc $# $#" % [args, toolname])
-  copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe)
+  copyFile(dest="bin" / splitFile(toolname).name.exe, source=toolname.exe)
 
 proc buildTools(latest: bool) =
   let nimsugExe = "bin/nimsuggest".exe