...
This commit is contained in:
@@ -24,20 +24,29 @@ public class ModuleRepository
|
||||
{
|
||||
case FuncSyntax funcDef:
|
||||
{
|
||||
var parameters = funcDef.Signature.Parameters.Select(x => new ModuleFunctionParameter(x.Name, x.Type)).ToList();
|
||||
var parameters = funcDef.Signature.Parameters
|
||||
.Select(x => new ModuleFunctionParameter(x.Name, x.Type))
|
||||
.ToList();
|
||||
|
||||
module.RegisterFunction(funcDef.Exported, funcDef.Name, funcDef.ExternSymbol, parameters, funcDef.Signature.ReturnType);
|
||||
break;
|
||||
}
|
||||
case StructSyntax structDef:
|
||||
{
|
||||
var fields = structDef.Fields.Select(x => new ModuleStructField(x.Name, x.Type, x.Value.HasValue)).ToList();
|
||||
var fields = structDef.Fields
|
||||
.Select(x => new ModuleStructField(x.Name, x.Type, x.Value.HasValue))
|
||||
.ToList();
|
||||
|
||||
var functions = new List<ModuleStructFunction>();
|
||||
foreach (var function in structDef.Functions)
|
||||
{
|
||||
var parameters = function.Signature.Parameters.Select(x => new ModuleStructFunctionParameter(x.Name, x.Type)).ToList();
|
||||
functions.AddRange(new ModuleStructFunction(function.Name, function.Hook, parameters, function.Signature.ReturnType));
|
||||
}
|
||||
var functions = structDef.Functions
|
||||
.Select(x =>
|
||||
{
|
||||
var parameters = x.Signature.Parameters
|
||||
.Select(y => new ModuleFunctionParameter(y.Name, y.Type))
|
||||
.ToList();
|
||||
|
||||
return new ModuleStructFunction(x.Name, x.Hook, parameters, x.Signature.ReturnType);
|
||||
})
|
||||
.ToList();
|
||||
|
||||
module.RegisterStruct(structDef.Exported, structDef.Name, fields, functions);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user