Skip to content

Commit

Permalink
Add intermediate representation
Browse files Browse the repository at this point in the history
  • Loading branch information
Equinox- committed Jun 4, 2024
1 parent 0629f40 commit 5ba608a
Show file tree
Hide file tree
Showing 14 changed files with 935 additions and 530 deletions.
10 changes: 1 addition & 9 deletions SchemaBuilder/PostprocessArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,9 @@ public sealed class PostprocessArgs
public SchemaConfig Patches;
public XmlSchema Schema;

public void TypeData(string typeName, out XmlTypeInfo typeInfo, out TypePatch typePatch)
public void TypeData(string typeName, out XmlTypeInfo typeInfo)
{
Info.TryGetTypeByXmlName(typeName, out typeInfo);
typePatch = Patches.TypePatch(typeName);
if (typePatch == null && typeInfo != null)
typePatch = Patches.TypePatch(typeInfo.Type.FullName);
if (typePatch != null || typeInfo == null)
return;
var mapped = DocReader.MapType(typeInfo.Type);
if (mapped != null)
typePatch = Patches.TypePatch(mapped.FullName);
}
}
}
304 changes: 0 additions & 304 deletions SchemaBuilder/PostprocessUnordered.cs

This file was deleted.

4 changes: 1 addition & 3 deletions SchemaBuilder/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using SchemaService.SteamUtils;
using SteamKit2;
Expand All @@ -18,7 +17,6 @@ public static async Task Main(string[] args)
svc.AddHostedService<GameManager>();
svc.AddSingleton<SchemaGenerator>();
svc.AddSingleton<DocReader>();
svc.AddSingleton<PostprocessUnordered>();
})
.Build();
await host.StartAsync();
Expand Down
8 changes: 7 additions & 1 deletion SchemaBuilder/SchemaBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@
<Compile Include="GameScriptCompiler.cs" />
<Compile Include="SchemaConfig.cs" />
<Compile Include="PostprocessArgs.cs" />
<Compile Include="PostprocessUnordered.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SchemaGenerator.cs" />
<Compile Include="SchemaIr.cs" />
<Compile Include="SchemaIrCompiler.cs" />
<Compile Include="SchemaIrConfig.cs" />
<Compile Include="SchemaIrDocumentation.cs" />
<Compile Include="SchemaIrToXsd.cs" />
<Compile Include="SerializationProxies.cs" />
<Compile Include="TaskAvoidance.cs" />
<Compile Include="UnionFind.cs" />
<Compile Include="XmlInfo.cs" />
<Compile Include="XmlNameConflictResolver.cs" />
<Compile Include="XmlReflection.cs" />
Expand Down Expand Up @@ -84,6 +89,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.4" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Loading

0 comments on commit 5ba608a

Please sign in to comment.