refl bugfix

This commit is contained in:
ouczbs 2024-07-03 19:56:34 +08:00
parent ce7f5bf520
commit aa73ac461f
2 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,10 @@ namespace refl
Console.WriteLine(message); Console.WriteLine(message);
} }
var module = ModuleMeta.ParseCompileInfo(compilation); var module = ModuleMeta.ParseCompileInfo(compilation);
if (ModuleMeta.NameSet.Count == 0)
{
return 0;
}
Gen gen = new Gen(); Gen gen = new Gen();
gen.GenCppMeta(module, opt.Output.ToLower()); gen.GenCppMeta(module, opt.Output.ToLower());
if (opt.Verbose) if (opt.Verbose)

View File

@ -55,6 +55,10 @@ namespace refl
data.Name = cls.Name; data.Name = cls.Name;
data.ParentName = cls.ParentName; data.ParentName = cls.ParentName;
bool isMulty = cls.Fields.Count > 1; bool isMulty = cls.Fields.Count > 1;
if(cls.Fields.Count == 1)
{
isMulty = cls.Fields.Keys.First() != "Meta";
}
foreach (var pair in cls.Fields) foreach (var pair in cls.Fields)
{ {
data.FieldList.Clear(); data.FieldList.Clear();