Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for handling internals #364

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
CHECK MY WORK! Fixed the RangeAcc<bool*> to check LegalFixedTypes and…
… correct.
  • Loading branch information
Thraka committed Mar 23, 2024
commit 4a45326b6224cd8e230f15e7fedc0f57548aefa0
5 changes: 5 additions & 0 deletions src/CodeGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ static async Task<int> Main(string[] args)
{
writer.WriteLine($"public RangeAccessor<{wrappedTypeName}> {field.Name} => new RangeAccessor<{wrappedTypeName}>({addrTarget}, {field.ArraySize});");
}

// Try best to hit the primitive pointers
else if (TypeInfo.LegalFixedTypes.Contains(typeStr[0..^1]))
writer.WriteLine($"public RangeAccessor<{typeStr[0..^1]}> {field.Name} => new RangeAccessor<{typeStr[0..^1]}>({addrTarget}, {field.ArraySize});");

else
throw new Exception("Expected to wrap type, but wrapped type not found");
}
Expand Down