Skip to content

Commit

Permalink
FlatBuffer.hs: Convert field names to camel-case.
Browse files Browse the repository at this point in the history
FlatBuffers converts field names to camel case, e.g., `foo_bar` becomes
`fooBar`.  There were two places where this conversion was missing.
  • Loading branch information
ryzhyk committed Feb 6, 2020
1 parent bc3a574 commit 8683016
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Language/DifferentialDatalog/FlatBuffer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ jConv2FBType fbctx e t =
-> jFBCallConstructor (typeTableName t) [jConv2FBType (FBField (typeTableName t) "v") e t]
-- FlatBuffers has a special method for embedding vectors in a buffer
FBField{..} | typeIsVector t
-> jFBPackage <> "." <> fbctxTable <> ".create" <> pp (capitalize fbctxField) <> "Vector(fbbuilder," <> e' <> ")"
-> jFBPackage <> "." <> fbctxTable <> ".create" <> pp (capitalize $ render $ jAccessorName fbctxField) <> "Vector(fbbuilder," <> e' <> ")"
| otherwise
-> e'
where
Expand Down Expand Up @@ -1320,7 +1320,7 @@ jReadField nesting fbctx e t =
-- Vectors are accessed via a pair of methods: `e.<field>Size` and
-- `e.<field>(i)`
FBField{..} | typeIsVector t
-> do_read (e <> "." <> pp fbctxField)
-> do_read (e <> "." <> jAccessorName fbctxField)
| not (typeHasUniqueConstructor t)
-> let tab = "__t" <> pp nesting in
do_read (e <> "." <> jAccessorName fbctxField <> "Type()," <+>
Expand Down

0 comments on commit 8683016

Please sign in to comment.