'using' statement is obsolete

This commit is contained in:
Andreas Rumpf
2016-02-28 14:48:15 +01:00
parent 1afdefcbe9
commit 7ae45ea420
3 changed files with 1 additions and 21 deletions

View File

@@ -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]