bindSym suffices; no 'bind' for macros anymore

This commit is contained in:
Araq 2012-08-25 01:34:50 +02:00
commit 9a7f0cd851
9 changed files with 48 additions and 73 deletions

View file

@ -1118,22 +1118,6 @@ proc insertDestructors(c: PContext, varSection: PNode):
return
proc semBindStmtForMacro(c: PContext, n: PNode): PNode =
if c.p.owner.kind != skMacro:
LocalError(n.info, errXNotAllowedHere, "bind")
result = newNodeI(nkBindStmt, n.info)
for i in 0 .. < n.len:
var a = n.sons[i]
let s = QualifiedLookUp(c, a)
if s != nil:
# we need to mark all symbols:
let sc = symChoice(c, a, s)
if sc.kind == nkSym: result.add(sc)
else:
for x in items(sc): result.add(x)
else:
illFormedAst(a)
proc SemStmt(c: PContext, n: PNode): PNode =
const # must be last statements in a block:
LastBlockStmts = {nkRaiseStmt, nkReturnStmt, nkBreakStmt, nkContinueStmt}
@ -1222,8 +1206,6 @@ proc SemStmt(c: PContext, n: PNode): PNode =
result = semPragmaBlock(c, n)
of nkStaticStmt:
result = semStaticStmt(c, n)
of nkBindStmt:
result = semBindStmtForMacro(c, n)
else:
# in interactive mode, we embed the expression in an 'echo':
if gCmd == cmdInteractive: