fixes #134
This commit is contained in:
parent
d1c84328a7
commit
05c981ea9b
2 changed files with 11 additions and 9 deletions
|
|
@ -73,21 +73,21 @@ proc rawImportSymbol(c: PContext, s: PSym) =
|
||||||
elif s.kind == skConverter:
|
elif s.kind == skConverter:
|
||||||
addConverter(c, s) # rodgen assures that converters are no stubs
|
addConverter(c, s) # rodgen assures that converters are no stubs
|
||||||
|
|
||||||
proc importSymbol(c: PContext, ident: PNode, fromMod: PSym) =
|
proc importSymbol(c: PContext, n: PNode, fromMod: PSym) =
|
||||||
if (ident.kind != nkIdent): InternalError(ident.info, "importSymbol")
|
let ident = lookups.considerAcc(n)
|
||||||
var s = StrTableGet(fromMod.tab, ident.ident)
|
let s = StrTableGet(fromMod.tab, ident)
|
||||||
if s == nil: GlobalError(ident.info, errUndeclaredIdentifier, ident.ident.s)
|
if s == nil: GlobalError(n.info, errUndeclaredIdentifier, ident.s)
|
||||||
if s.kind == skStub: loadStub(s)
|
if s.kind == skStub: loadStub(s)
|
||||||
if not (s.Kind in ExportableSymKinds):
|
if s.Kind notin ExportableSymKinds:
|
||||||
InternalError(ident.info, "importSymbol: 2")
|
InternalError(n.info, "importSymbol: 2")
|
||||||
# for an enumeration we have to add all identifiers
|
# for an enumeration we have to add all identifiers
|
||||||
case s.Kind
|
case s.Kind
|
||||||
of skProc, skMethod, skIterator, skMacro, skTemplate, skConverter:
|
of skProc, skMethod, skIterator, skMacro, skTemplate, skConverter:
|
||||||
# for a overloadable syms add all overloaded routines
|
# for a overloadable syms add all overloaded routines
|
||||||
var it: TIdentIter
|
var it: TIdentIter
|
||||||
var e = InitIdentIter(it, fromMod.tab, s.name)
|
var e = InitIdentIter(it, fromMod.tab, s.name)
|
||||||
while e != nil:
|
while e != nil:
|
||||||
if (e.name.id != s.Name.id): InternalError(ident.info, "importSymbol: 3")
|
if e.name.id != s.Name.id: InternalError(n.info, "importSymbol: 3")
|
||||||
rawImportSymbol(c, e)
|
rawImportSymbol(c, e)
|
||||||
e = NextIdentIter(it, fromMod.tab)
|
e = NextIdentIter(it, fromMod.tab)
|
||||||
else: rawImportSymbol(c, s)
|
else: rawImportSymbol(c, s)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import macros
|
import macros
|
||||||
|
|
||||||
|
from uri import `/`
|
||||||
|
|
||||||
macro test*(a: stmt): stmt =
|
macro test*(a: stmt): stmt =
|
||||||
var nodes: tuple[a, b: int]
|
var nodes: tuple[a, b: int]
|
||||||
nodes.a = 4
|
nodes.a = 4
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue