bugfix: make visibility more robust for macros
This commit is contained in:
parent
041054e038
commit
f7f3d70a68
1 changed files with 3 additions and 3 deletions
|
|
@ -398,15 +398,15 @@ proc semIdentVis(c: PContext, kind: TSymKind, n: PNode,
|
||||||
allowed: TSymFlags): PSym =
|
allowed: TSymFlags): PSym =
|
||||||
# identifier with visibility
|
# identifier with visibility
|
||||||
if n.kind == nkPostfix:
|
if n.kind == nkPostfix:
|
||||||
if sonsLen(n) == 2 and n.sons[0].kind == nkIdent:
|
if sonsLen(n) == 2:
|
||||||
# for gensym'ed identifiers the identifier may already have been
|
# for gensym'ed identifiers the identifier may already have been
|
||||||
# transformed to a symbol and we need to use that here:
|
# transformed to a symbol and we need to use that here:
|
||||||
result = newSymG(kind, n.sons[1], c)
|
result = newSymG(kind, n.sons[1], c)
|
||||||
var v = n.sons[0].ident
|
var v = considerQuotedIdent(n.sons[0])
|
||||||
if sfExported in allowed and v.id == ord(wStar):
|
if sfExported in allowed and v.id == ord(wStar):
|
||||||
incl(result.flags, sfExported)
|
incl(result.flags, sfExported)
|
||||||
else:
|
else:
|
||||||
localError(n.sons[0].info, errInvalidVisibilityX, v.s)
|
localError(n.sons[0].info, errInvalidVisibilityX, renderTree(n[0]))
|
||||||
else:
|
else:
|
||||||
illFormedAst(n)
|
illFormedAst(n)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue