From a0e67875a14061ba731d743d6c7f03c561a46e44 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 30 Aug 2012 17:01:55 -0700 Subject: DafnyExtension: don't duplicate names of inherited identifiers --- Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Util/VS2010') diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs index 7dbf5402..80a6dbb5 100644 --- a/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs +++ b/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs @@ -285,11 +285,16 @@ namespace DafnyLanguage 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 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)); } } @@ -298,7 +303,7 @@ namespace DafnyLanguage 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)); } } -- cgit v1.2.3