diff options
author | Unknown <leino@LEINO6.redmond.corp.microsoft.com> | 2012-08-30 17:01:55 -0700 |
---|---|---|
committer | Unknown <leino@LEINO6.redmond.corp.microsoft.com> | 2012-08-30 17:01:55 -0700 |
commit | a0e67875a14061ba731d743d6c7f03c561a46e44 (patch) | |
tree | d919ba1e75b9ee5ac5e4e3c28856d250757a990c /Util/VS2010 | |
parent | dcc10fd61f7056542bc61c096a851aa76f6d688f (diff) |
DafnyExtension: don't duplicate names of inherited identifiers
Diffstat (limited to 'Util/VS2010')
-rw-r--r-- | Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs | 9 |
1 files changed, 7 insertions, 2 deletions
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<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));
}
}
@@ -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));
}
}
|