Closed skattegard closed 11 months ago
When using record struct, the New() method and the Empty public field was removed when cleaning up the baseDef.
record struct
New()
Empty
I parse the Empty declaration, and New() declaration if present, and inserted before the constructor. So they wouldnt be removed later in the process.
I moved some of the methods in the (TYPENAME)_base.cs classes, so that the Empty field could serve as a delimiter on what to keep in the baseDef.
I also added some "dummy" test to see that the Empty and New() is generated correctly.
Looks good
When using
record struct
, theNew()
method and theEmpty
public field was removed when cleaning up the baseDef.I parse the
Empty
declaration, andNew()
declaration if present, and inserted before the constructor. So they wouldnt be removed later in the process.I moved some of the methods in the (TYPENAME)_base.cs classes, so that the
Empty
field could serve as a delimiter on what to keep in the baseDef.I also added some "dummy" test to see that the
Empty
andNew()
is generated correctly.