summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-10-13 03:03:05 +0200
committerAraq <rumpf_a@web.de>2015-10-13 03:03:05 +0200
commit2fda95a4d630aa8b293f16e4f21471f7ee8e743a (patch)
treea1cb16e8951d736401483406ab6a1b0018df74ea /compiler
parentd8b0edc3230b6bc1902522b40c12862487fafc82 (diff)
downloadNim-2fda95a4d630aa8b293f16e4f21471f7ee8e743a.tar.gz
added getOrDefault; bootstrapping works again
Diffstat (limited to 'compiler')
-rw-r--r--compiler/importer.nim4
-rw-r--r--compiler/main.nim2
-rw-r--r--compiler/nimblecmd.nim2
-rw-r--r--compiler/options.nim2
-rw-r--r--compiler/vmmarshal.nim2
5 files changed, 6 insertions, 6 deletions
diff --git a/compiler/importer.nim b/compiler/importer.nim
index 657f41eab..c121059fd 100644
--- a/compiler/importer.nim
+++ b/compiler/importer.nim
@@ -121,7 +121,7 @@ proc importAllSymbolsExcept(c: PContext, fromMod: PSym, exceptSet: IntSet) =
       if s.kind != skEnumField:
         if s.kind notin ExportableSymKinds:
           internalError(s.info, "importAllSymbols: " & $s.kind)
-        if s.name.id notin exceptSet:
+        if exceptSet.isNil or s.name.id notin exceptSet:
           rawImportSymbol(c, s)
     s = nextIter(i, fromMod.tab)
 
@@ -138,7 +138,7 @@ proc importForwarded(c: PContext, n: PNode, exceptSet: IntSet) =
       let s = a.sym
       if s.kind == skModule:
         importAllSymbolsExcept(c, s, exceptSet)
-      elif s.name.id notin exceptSet:
+      elif exceptSet.isNil or s.name.id notin exceptSet:
         rawImportSymbol(c, s)
   of nkExportExceptStmt:
     localError(n.info, errGenerated, "'export except' not implemented")
diff --git a/compiler/main.nim b/compiler/main.nim
index 3bb6fc343..2ee07a443 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -15,7 +15,7 @@ import
   wordrecg, sem, semdata, idents, passes, docgen, extccomp,
   cgen, jsgen, json, nversion,
   platform, nimconf, importer, passaux, depends, vm, vmdef, types, idgen,
-  tables, docgen2, service, parser, modules, ccgutils, sigmatch, ropes, lists
+  docgen2, service, parser, modules, ccgutils, sigmatch, ropes, lists
 
 from magicsys import systemModule, resetSysTypes
 
diff --git a/compiler/nimblecmd.nim b/compiler/nimblecmd.nim
index 9b647e67d..c6c2ab058 100644
--- a/compiler/nimblecmd.nim
+++ b/compiler/nimblecmd.nim
@@ -48,7 +48,7 @@ proc addPackage(packages: StringTableRef, p: string) =
   let name = p.substr(0, x-1)
   if x < p.len:
     let version = p.substr(x+1)
-    if packages[name] <. version:
+    if packages.getOrDefault(name) <. version:
       packages[name] = version
   else:
     packages[name] = latest
diff --git a/compiler/options.nim b/compiler/options.nim
index 23c76acc5..98224a11d 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -173,7 +173,7 @@ proc existsConfigVar*(key: string): bool =
   result = hasKey(gConfigVars, key)
 
 proc getConfigVar*(key: string): string =
-  result = gConfigVars[key]
+  result = gConfigVars.getOrDefault key
 
 proc setConfigVar*(key, val: string) =
   gConfigVars[key] = val
diff --git a/compiler/vmmarshal.nim b/compiler/vmmarshal.nim
index 1670dd4c4..c08c5d249 100644
--- a/compiler/vmmarshal.nim
+++ b/compiler/vmmarshal.nim
@@ -239,7 +239,7 @@ proc loadAny(p: var JsonParser, t: PType,
       result = newNode(nkNilLit)
       next(p)
     of jsonInt:
-      result = tab[p.getInt]
+      result = tab.getOrDefault(p.getInt)
       if result.isNil:
         raiseParseErr(p, "cannot load object with address " & $p.getInt)
       next(p)