This commit is contained in:
nub31
2026-02-25 21:51:32 +01:00
parent cb4aeb9c01
commit 49734544e6
6 changed files with 50 additions and 150 deletions

View File

@@ -99,7 +99,7 @@ public record Manifest(Dictionary<string, Manifest.Module> Modules)
return typeInfo switch
{
Compiler.Module.TypeInfoStruct s => new Module.TypeInfoStruct(s.Packed, s.Fields.Select(x => new Module.TypeInfoStruct.Field(x.Name, x.Type)).ToList()),
Compiler.Module.TypeInfoEnum e => new Module.TypeInfoEnum(e.Variants.Select(v => new Module.TypeInfoEnum.Variant(v.Name, v.Fields.Select(x => new Module.TypeInfoEnum.Variant.Field(x.Name, x.Type)).ToList())).ToList()),
Compiler.Module.TypeInfoEnum e => new Module.TypeInfoEnum(e.Variants.Select(v => new Module.TypeInfoEnum.Variant(v.Name, v.Type)).ToList()),
_ => throw new ArgumentOutOfRangeException(nameof(typeInfo))
};
}
@@ -121,10 +121,7 @@ public record Manifest(Dictionary<string, Manifest.Module> Modules)
public record TypeInfoEnum(IReadOnlyList<TypeInfoEnum.Variant> Variants) : TypeInfo
{
public record Variant(string Name, List<Variant.Field> Fields)
{
public record Field(string Name, NubType Type);
}
public record Variant(string Name, NubType Type);
}
}
}