Exception thrown while trying to print back an AST
# #require "clangml";;
# let f = Clang.Ast.parse_string "#include <inttypes.h>";;
# let t = Clang.Translation_unit.make f.desc.items;;
# open Clang.Ast;;
# #require "clangml.printer";;
let decoration = Custom { location = None; qual_type = None } in
let decorated_decls = { desc = t; decoration } in
Clangml_printer.translation_unit Format.std_formatter decorated_decls
;;
Exception:
Failure
"Not implemented decl: { decoration = <opaque>;\n desc =\n TypedefDecl\n { name = \"__int8_t\";\n underlying_type =\n { cxtype = <opaque>; type_loc = <opaque>;\n "... (* string length 460; truncated *).
Raised at file "pervasives.ml", line 32, characters 22-33
Called from file "format.ml", line 1202, characters 4-14
Called from file "format.ml", line 1276, characters 4-20
Called from file "format.ml", line 1337, characters 20-38
Called from file "toplevel/toploop.ml", line 180, characters 17-56
I hope I'm not mis-using the API? I didn't know what to provide for the decoration field while trying to construct the value that Clangml_printer.translation_unit
wants so I put in some defaults.