summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-02-28 14:48:15 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-02-28 14:48:15 +0100
commit7ae45ea4202a71df134dbe0ca74c0b944dc1f48a (patch)
treeb820191133f341b6e9358d0d318fbb08870d7d8b
parent1afdefcbe930b042e5f81b30b960c67bed1e859b (diff)
downloadNim-7ae45ea4202a71df134dbe0ca74c0b944dc1f48a.tar.gz
'using' statement is obsolete
-rw-r--r--compiler/ast.nim1
-rw-r--r--compiler/semcall.nim5
-rw-r--r--compiler/semexprs.nim16
3 files changed, 1 insertions, 21 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index a7fb7c7e9..54b96d69e 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -754,7 +754,6 @@ type
   TScope* = object
     depthLevel*: int
     symbols*: TStrTable
-    usingSyms*: seq[PNode]
     parent*: PScope
 
   PScope* = ref TScope
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 51cc8bfb0..2fb226404 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -143,11 +143,6 @@ proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
   else:
     localError(n.info, errGenerated, result)
 
-proc gatherUsedSyms(c: PContext, usedSyms: var seq[PNode]) =
-  for scope in walkScopes(c.currentScope):
-    if scope.usingSyms != nil:
-      for s in scope.usingSyms: usedSyms.safeAdd(s)
-
 proc resolveOverloads(c: PContext, n, orig: PNode,
                       filter: TSymKinds;
                       errors: var CandidateErrors): TCandidate =
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 6009644fa..d27edf304 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1558,21 +1558,7 @@ proc newAnonSym(kind: TSymKind, info: TLineInfo,
 
 proc semUsing(c: PContext, n: PNode): PNode =
   result = newNodeI(nkEmpty, n.info)
-  if not experimentalMode(c):
-    localError(n.info, "use the {.experimental.} pragma to enable 'using'")
-  for e in n.sons:
-    let usedSym = semExpr(c, e)
-    if usedSym.kind == nkSym:
-      case usedSym.sym.kind
-      of skLocalVars + {skConst}:
-        c.currentScope.usingSyms.safeAdd(usedSym)
-        continue
-      of skProcKinds:
-        addDeclAt(c.currentScope, usedSym.sym)
-        continue
-      else: discard
-
-    localError(e.info, errUsingNoSymbol, e.renderTree)
+  localError(n.info, "'using' statement is obsolete")
 
 proc semExpandToAst(c: PContext, n: PNode): PNode =
   var macroCall = n[1]