Split WoofWare.PawPrint.Domain into a new subtree (#41)

This commit is contained in:
Patrick Stevens
2025-06-04 20:13:16 +01:00
committed by GitHub
parent 15bae6f3aa
commit 19eb7c245d
26 changed files with 62 additions and 30 deletions

View File

@@ -0,0 +1,16 @@
namespace WoofWare.PawPrint
open System.Reflection.Metadata
open System.Reflection.Metadata.Ecma335
type StringToken =
| UserString of UserStringHandle
| String of StringHandle
[<RequireQualifiedAccess>]
module StringToken =
let ofInt (value : int) : StringToken =
match LanguagePrimitives.EnumOfValue<byte, HandleKind> (byte (value &&& 0xFF000000 >>> 24)) with
| HandleKind.UserString -> StringToken.UserString (MetadataTokens.UserStringHandle value)
| HandleKind.String -> StringToken.String (MetadataTokens.StringHandle value)
| v -> failwith $"Unrecognised string handle kind: {v}"