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 placeholder for struct field types #226

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hs-bindgen/fixtures/enums.hs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
List {getList = [DeclInstance (InstanceStorable (WithStruct (Struct {structName = "First", structConstr = "MkFirst", structFields = "unfirst" ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "First", structConstr = "MkFirst", structFields = "unfirst" ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "First", structConstr = "MkFirst", structFields = "unfirst" ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))}))), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Second", structConstr = "MkSecond", structFields = "unsecond" ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Second", structConstr = "MkSecond", structFields = "unsecond" ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Second", structConstr = "MkSecond", structFields = "unsecond" ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))}))), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Same", structConstr = "MkSame", structFields = "unsame" ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Same", structConstr = "MkSame", structFields = "unsame" ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Same", structConstr = "MkSame", structFields = "unsame" ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))}))), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Packad", structConstr = "MkPackad", structFields = "unpackad" ::: VNil}) (StorableInstance {storableSizeOf = 1, storableAlignment = 1, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Packad", structConstr = "MkPackad", structFields = "unpackad" ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Packad", structConstr = "MkPackad", structFields = "unpackad" ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))})))]}
List {getList = [DeclInstance (InstanceStorable (WithStruct (Struct {structName = "First", structConstr = "MkFirst", structFields = ("unfirst",HsType "EnumTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "First", structConstr = "MkFirst", structFields = ("unfirst",HsType "EnumTypeTODO") ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "First", structConstr = "MkFirst", structFields = ("unfirst",HsType "EnumTypeTODO") ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))}))), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Second", structConstr = "MkSecond", structFields = ("unsecond",HsType "EnumTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Second", structConstr = "MkSecond", structFields = ("unsecond",HsType "EnumTypeTODO") ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Second", structConstr = "MkSecond", structFields = ("unsecond",HsType "EnumTypeTODO") ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))}))), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Same", structConstr = "MkSame", structFields = ("unsame",HsType "EnumTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 4, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Same", structConstr = "MkSame", structFields = ("unsame",HsType "EnumTypeTODO") ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Same", structConstr = "MkSame", structFields = ("unsame",HsType "EnumTypeTODO") ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))}))), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Packad", structConstr = "MkPackad", structFields = ("unpackad",HsType "EnumTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 1, storableAlignment = 1, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Packad", structConstr = "MkPackad", structFields = ("unpackad",HsType "EnumTypeTODO") ::: VNil})) [PeekByteOff x0 0]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Packad", structConstr = "MkPackad", structFields = ("unpackad",HsType "EnumTypeTODO") ::: VNil}) (\(x1 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1]}))))})))]}
2 changes: 1 addition & 1 deletion hs-bindgen/fixtures/fixedwidth.hs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
List {getList = [DeclData (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "sixty_four" ::: "thirty_two" ::: VNil}) (MkDataDecl)), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "sixty_four" ::: "thirty_two" ::: VNil}) (StorableInstance {storableSizeOf = 16, storableAlignment = 8, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "sixty_four" ::: "thirty_two" ::: VNil})) [PeekByteOff x0 0, PeekByteOff x0 64]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "sixty_four" ::: "thirty_two" ::: VNil}) (\(x1 ::: x2 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1, PokeByteOff x0 64 x2]}))))})))]}
List {getList = [DeclData (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("sixty_four",HsType "StructFieldTypeTODO") ::: ("thirty_two",HsType "StructFieldTypeTODO") ::: VNil}) (MkDataDecl)), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("sixty_four",HsType "StructFieldTypeTODO") ::: ("thirty_two",HsType "StructFieldTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 16, storableAlignment = 8, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("sixty_four",HsType "StructFieldTypeTODO") ::: ("thirty_two",HsType "StructFieldTypeTODO") ::: VNil})) [PeekByteOff x0 0, PeekByteOff x0 64]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("sixty_four",HsType "StructFieldTypeTODO") ::: ("thirty_two",HsType "StructFieldTypeTODO") ::: VNil}) (\(x1 ::: x2 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1, PokeByteOff x0 64 x2]}))))})))]}
2 changes: 1 addition & 1 deletion hs-bindgen/fixtures/nested_types.hs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
List {getList = [DeclData (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "i" ::: "c" ::: VNil}) (MkDataDecl)), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "i" ::: "c" ::: VNil}) (StorableInstance {storableSizeOf = 8, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "i" ::: "c" ::: VNil})) [PeekByteOff x0 0, PeekByteOff x0 32]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = "i" ::: "c" ::: VNil}) (\(x1 ::: x2 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1, PokeByteOff x0 32 x2]}))))}))), DeclData (WithStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = "foo1" ::: "foo2" ::: VNil}) (MkDataDecl)), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = "foo1" ::: "foo2" ::: VNil}) (StorableInstance {storableSizeOf = 16, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = "foo1" ::: "foo2" ::: VNil})) [PeekByteOff x0 0, PeekByteOff x0 64]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = "foo1" ::: "foo2" ::: VNil}) (\(x1 ::: x2 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1, PokeByteOff x0 64 x2]}))))})))]}
List {getList = [DeclData (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("i",HsType "StructFieldTypeTODO") ::: ("c",HsType "StructFieldTypeTODO") ::: VNil}) (MkDataDecl)), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("i",HsType "StructFieldTypeTODO") ::: ("c",HsType "StructFieldTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 8, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("i",HsType "StructFieldTypeTODO") ::: ("c",HsType "StructFieldTypeTODO") ::: VNil})) [PeekByteOff x0 0, PeekByteOff x0 32]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Foo", structConstr = "MkFoo", structFields = ("i",HsType "StructFieldTypeTODO") ::: ("c",HsType "StructFieldTypeTODO") ::: VNil}) (\(x1 ::: x2 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1, PokeByteOff x0 32 x2]}))))}))), DeclData (WithStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = ("foo1",HsType "StructFieldTypeTODO") ::: ("foo2",HsType "StructFieldTypeTODO") ::: VNil}) (MkDataDecl)), DeclInstance (InstanceStorable (WithStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = ("foo1",HsType "StructFieldTypeTODO") ::: ("foo2",HsType "StructFieldTypeTODO") ::: VNil}) (StorableInstance {storableSizeOf = 16, storableAlignment = 4, storablePeek = Lambda (\x0 -> Ap (IntroStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = ("foo1",HsType "StructFieldTypeTODO") ::: ("foo2",HsType "StructFieldTypeTODO") ::: VNil})) [PeekByteOff x0 0, PeekByteOff x0 64]), storablePoke = Lambda (\x0 -> ElimStruct (Struct {structName = "Bar", structConstr = "MkBar", structFields = ("foo1",HsType "StructFieldTypeTODO") ::: ("foo2",HsType "StructFieldTypeTODO") ::: VNil}) (\(x1 ::: x2 ::: VNil) -> (Seq (List {getList = [PokeByteOff x0 0 x1, PokeByteOff x0 64 x2]}))))})))]}
Loading
Loading