Skip to content

Commit

Permalink
DafnyExtension: don't duplicate names of inherited identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown authored and Unknown committed Aug 31, 2012
1 parent dcc10fd commit a0e6787
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,16 @@ class IdRegion
public enum OccurrenceKind { Use, Definition, WildDefinition }
public readonly OccurrenceKind Kind;

static bool SurfaceSyntaxToken(Bpl.IToken tok) {
Contract.Requires(tok != null);
return !(tok is TokenWrapper);
}

public static void Add(List<IdRegion> regions, Bpl.IToken tok, IVariable v, bool isDefinition, ModuleDefinition context) {
Contract.Requires(regions != null);
Contract.Requires(tok != null);
Contract.Requires(v != null);
if (!(tok is AutoGeneratedToken)) {
if (SurfaceSyntaxToken(tok)) {
regions.Add(new IdRegion(tok, v, isDefinition, context));
}
}
Expand All @@ -298,7 +303,7 @@ public enum OccurrenceKind { Use, Definition, WildDefinition }
Contract.Requires(tok != null);
Contract.Requires(decl != null);
Contract.Requires(kind != null);
if (!(tok is AutoGeneratedToken)) {
if (SurfaceSyntaxToken(tok)) {
regions.Add(new IdRegion(tok, decl, kind, isDefinition, context));
}
}
Expand Down

0 comments on commit a0e6787

Please sign in to comment.