// Trace mode entry point public TypeDefinitionCompiler(AssemblyCompiler parent, TypeTrace typeTrace) { Env = parent.Env; Parent = parent; TyconEnv = parent.AssmEnv.AddType(typeTrace.Type); this.TypeTrace = typeTrace; if (typeTrace.IncludeType && typeTrace.Parent.Parent.Flavor == TraceFlavor.Remainder) { // Create a self-loader fragment file NameSupply = new JST.NameSupply(Constants.Globals); // Will be bound by function passed to root's BindType RootId = NameSupply.GenSym(); AssemblyId = NameSupply.GenSym(); TypeDefinitionId = NameSupply.GenSym(); } else { // Possibly inline type definition and/or method definitions into trace NameSupply = parent.NameSupply; // Already bound by parent RootId = parent.RootId; AssemblyId = parent.AssemblyId; // Will be bound locally TypeDefinitionId = NameSupply.GenSym(); } }
// Collecting mode entry point public TypeDefinitionCompiler(AssemblyCompiler parent, CST.TypeDef typeDef) { Env = parent.Env; Parent = parent; TyconEnv = parent.AssmEnv.AddType(typeDef); TypeTrace = null; // Inline type definition and method definitions into overall assembly NameSupply = parent.NameSupply; // Already bound by parent RootId = parent.RootId; AssemblyId = parent.AssemblyId; // Will be bound locally TypeDefinitionId = NameSupply.GenSym(); }