Esempio n. 1
0
            private IdRegion(Bpl.IToken tok, Field decl, Microsoft.Dafny.Type showType, string kind, bool isDefinition, ModuleDefinition context)
            {
                Contract.Requires(tok != null);
                Contract.Requires(decl != null);
                Contract.Requires(kind != null);
                if (showType == null)
                {
                    showType = decl.Type;
                }
                Start  = tok.pos;
                Length = decl.Name.Length;
                var name = decl.EnclosingClass != null && !(decl.EnclosingClass is DefaultClassDecl) ? decl.FullNameInContext(context) : decl.Name; // some built-in members like "Keys" may not have an .EnclosingClass

                HoverText = string.Format("({4}{2}{3}) {0}: {1}", name, showType.TypeName(context),
                                          decl.IsGhost ? "ghost " : "",
                                          kind,
                                          decl.IsUserMutable || decl is ConstantField || decl is DatatypeDestructor ? "" : decl.IsMutable ? " non-assignable " : "immutable ");
                Kind = !isDefinition ? OccurrenceKind.Use : OccurrenceKind.Definition;
            }
Esempio n. 2
0
 private IdRegion(Bpl.IToken tok, Field decl, Microsoft.Dafny.Type showType, string kind, bool isDefinition, ModuleDefinition context)
 {
     Contract.Requires(tok != null);
     Contract.Requires(decl != null);
     Contract.Requires(kind != null);
     if (showType == null)
     {
         showType = decl.Type;
     }
     Start     = tok.pos;
     Length    = decl.Name.Length;
     HoverText = string.Format("({4}{2}{3}) {0}: {1}", decl.FullNameInContext(context), showType.TypeName(context),
                               decl.IsGhost ? "ghost " : "",
                               kind,
                               decl.IsUserMutable || decl is DatatypeDestructor ? "" : decl.IsMutable ? " non-assignable " : "immutable ");
     Kind = !isDefinition ? OccurrenceKind.Use : OccurrenceKind.Definition;
 }