Only add exported and not external functions and types to manifest
This commit is contained in:
@@ -85,7 +85,7 @@ public class ModuleGraph
|
||||
switch (type)
|
||||
{
|
||||
case Manifest.Module.TypeInfoStruct s:
|
||||
var info = new Module.TypeInfoStruct(s.Exported, s.Packed);
|
||||
var info = new Module.TypeInfoStruct(true, s.Packed, true);
|
||||
var fields = s.Fields.Select(x => new Module.TypeInfoStruct.Field(x.Name, x.Type)).ToList();
|
||||
info.SetFields(fields);
|
||||
module.AddType(name, info);
|
||||
@@ -97,7 +97,7 @@ public class ModuleGraph
|
||||
|
||||
foreach (var (name, identifier) in manifestModule.Identifiers)
|
||||
{
|
||||
module.AddIdentifier(name, new Module.IdentifierInfo(identifier.Exported, identifier.Type, identifier.MangledName, true));
|
||||
module.AddIdentifier(name, new Module.IdentifierInfo(true, identifier.Type, identifier.MangledName, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class ModuleGraph
|
||||
|
||||
foreach (var structDef in ast.Definitions.OfType<NodeDefinitionStruct>())
|
||||
{
|
||||
module.AddType(structDef.Name.Ident, new Module.TypeInfoStruct(structDef.Exported, structDef.Packed));
|
||||
module.AddType(structDef.Name.Ident, new Module.TypeInfoStruct(structDef.Exported, structDef.Packed, false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,12 +269,13 @@ public class Module(string name)
|
||||
public bool External { get; } = external;
|
||||
}
|
||||
|
||||
public abstract class TypeInfo(bool exported)
|
||||
public abstract class TypeInfo(bool exported, bool external)
|
||||
{
|
||||
public bool Exported { get; } = exported;
|
||||
public bool External { get; } = external;
|
||||
}
|
||||
|
||||
public class TypeInfoStruct(bool exported, bool packed) : TypeInfo(exported)
|
||||
public class TypeInfoStruct(bool exported, bool packed, bool external) : TypeInfo(exported, external)
|
||||
{
|
||||
private IReadOnlyList<Field>? fields;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user