void FrameExprRegions(FrameExpression fe, List <IdRegion> regions, bool descendIntoExpressions, Microsoft.Ivy.Program prog, ModuleDefinition module) { Contract.Requires(fe != null); Contract.Requires(regions != null); Contract.Requires(prog != null); if (descendIntoExpressions) { ExprRegions(fe.E, regions, prog, module); } if (fe.Field != null) { Microsoft.Ivy.Type showType = null; // TODO: if we had the instantiated type of this field, that would have been nice to use here (but the Resolver currently does not compute or store the instantiated type for a FrameExpression) IdRegion.Add(regions, prog, fe.tok, fe.Field, showType, "field", false, module); RecordUseAndDef(prog, fe.tok, fe.Field.Name.Length, fe.Field.tok); } }
private IdRegion(Bpl.IToken tok, Field decl, Microsoft.Ivy.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; }
public static void Add(List <IdRegion> regions, Microsoft.Ivy.Program prog, Bpl.IToken tok, Field decl, Microsoft.Ivy.Type showType, string kind, bool isDefinition, ModuleDefinition context) { Contract.Requires(regions != null); Contract.Requires(prog != null); Contract.Requires(tok != null); Contract.Requires(decl != null); Contract.Requires(kind != null); if (InMainFileAndUserDefined(prog, tok)) { regions.Add(new IdRegion(tok, decl, showType, kind, isDefinition, context)); } }