Browse Source

Check for already visited declarations when checking duplicate names.

pull/1/head
triton 13 years ago
parent
commit
2dd3cbdaeb
  1. 13
      src/Generator/Passes/DuplicatedNamesCheckerPass.cs

13
src/Generator/Passes/DuplicatedNamesCheckerPass.cs

@ -22,12 +22,25 @@ namespace Cxxi.Passes @@ -22,12 +22,25 @@ namespace Cxxi.Passes
public override bool VisitDeclaration(Declaration decl)
{
if (AlreadyVisited(decl))
return true;
Visited.Add(decl);
CheckDuplicate(decl);
return base.VisitDeclaration(decl);
}
public override bool VisitParameterDecl(Parameter parameter)
{
return true;
}
void CheckDuplicate(Declaration decl)
{
if (string.IsNullOrWhiteSpace(decl.Name))
return;
Declaration duplicate;
// If the name is not yet on the map, then add it.

Loading…
Cancel
Save