Skip to content

Commit

Permalink
partial integration of pull 190
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Dec 31, 2011
1 parent 98a87cf commit 12d62ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/dsymbol.c
Expand Up @@ -779,7 +779,7 @@ Dsymbol *ScopeDsymbol::search(Loc loc, Identifier *ident, int flags)

// Look in imported modules
for (size_t i = 0; i < imports->dim; i++)
{ ScopeDsymbol *ss = (*imports)[i];
{ Dsymbol *ss = (*imports)[i];
Dsymbol *s2;

// If private import, don't search it
Expand Down Expand Up @@ -842,7 +842,7 @@ Dsymbol *ScopeDsymbol::search(Loc loc, Identifier *ident, int flags)
if (flags & 4) // if return NULL on ambiguity
return NULL;
if (!(flags & 2))
ss->multiplyDefined(loc, s, s2);
ScopeDsymbol::multiplyDefined(loc, s, s2);
break;
}
}
Expand All @@ -869,19 +869,19 @@ Dsymbol *ScopeDsymbol::search(Loc loc, Identifier *ident, int flags)
return s;
}

void ScopeDsymbol::importScope(ScopeDsymbol *s, enum PROT protection)
void ScopeDsymbol::importScope(Dsymbol *s, enum PROT protection)
{
//printf("%s->ScopeDsymbol::importScope(%s, %d)\n", toChars(), s->toChars(), protection);

// No circular or redundant import's
if (s != this)
{
if (!imports)
imports = new ScopeDsymbols();
imports = new Dsymbols();
else
{
for (size_t i = 0; i < imports->dim; i++)
{ ScopeDsymbol *ss = (*imports)[i];
{ Dsymbol *ss = (*imports)[i];
if (ss == s) // if already imported
{
if (protection > prots[i])
Expand Down
4 changes: 2 additions & 2 deletions src/dsymbol.h
Expand Up @@ -253,14 +253,14 @@ struct ScopeDsymbol : Dsymbol
Dsymbols *members; // all Dsymbol's in this scope
DsymbolTable *symtab; // members[] sorted into table

ScopeDsymbols *imports; // imported ScopeDsymbol's
Dsymbols *imports; // imported Dsymbol's
unsigned char *prots; // array of PROT, one for each import

ScopeDsymbol();
ScopeDsymbol(Identifier *id);
Dsymbol *syntaxCopy(Dsymbol *s);
Dsymbol *search(Loc loc, Identifier *ident, int flags);
void importScope(ScopeDsymbol *s, enum PROT protection);
void importScope(Dsymbol *s, enum PROT protection);
int isforwardRef();
void defineRef(Dsymbol *s);
static void multiplyDefined(Loc loc, Dsymbol *s1, Dsymbol *s2);
Expand Down

0 comments on commit 12d62ca

Please sign in to comment.