Expand description
Generate ocaml deserialization code for our types.
This binary runs charon on itself and generates the appropriate <type>_of_json functions for
our types. The generated functions are inserted into ./generate-ml/GAstOfJson.template.ml to
construct the final GAstOfJson.ml.
To run it, call cargo run --bin generate-ml. It is also run by make generate-ml in the
crate root. Donβt forget to format the output code after regenerating.
StructsΒ§
- DeriveVisitors π
- GenerateCode πFor 
- Replace markers in templatewith auto-generated code.
- GenerateCtx π
EnumsΒ§
- GenerationKind π
- The kind of code generation to perform.
FunctionsΒ§
- build_branch π
- build_doc_ πcomment 
- Make a doc comment that contains the given string, indenting it if necessary.
- build_function π
- build_type π
- convert_vars π
- extract_doc_ πcomments 
- generate_ml π
- generate_visitor_ πbases 
- main π
- make_ocaml_ πident 
- repr_name π
- Nameis a complex datastructure; to inspect it we serialize it a little bit.
- type_decl_ πto_ json_ deserializer 
- type_decl_ πto_ ocaml_ decl 
- Generate an ocaml type declaration that mirrors decl.
- type_name_ πto_ ocaml_ ident 
- type_to_ πocaml_ call 
- Converts a type to the appropriate *_of_jsoncall. In case of generics, this combines several functions, e.g.list_of_json bool_of_json.
- type_to_ πocaml_ name 
- Converts a type to the appropriate ocaml name. In case of generics, this provides appropriate parameters.