From 7ae45ea4202a71df134dbe0ca74c0b944dc1f48a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 28 Feb 2016 14:48:15 +0100 Subject: 'using' statement is obsolete --- compiler/ast.nim | 1 - compiler/semcall.nim | 5 ----- compiler/semexprs.nim | 16 +--------------- 3 files changed, 1 insertion(+), 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] -- cgit 1.4.1-2-gfad0