Make rupro folded class available to OCaml
commit9e070d1e267e400c530ba1df6aa00f47fe3add81
authorMillie Chen <milliechen@fb.com>
Fri, 4 Mar 2022 02:46:16 +0000 (3 18:46 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 4 Mar 2022 02:46:16 +0000 (3 18:46 -0800)
treeb973c1ac6d6822a944b76cffc8c20855a2419fdc
parent4a048dd8b1d83e68c62567c7d4105bebb14f64a2
Make rupro folded class available to OCaml

Summary:
Introduce an FFI that takes in a source file and applies the rupro folding logic to produce the folded class in that file along with the class name, returning the values in OCaml
```
external decl_folded_class_in_file :
  Relative_path.t -> (Decl_defs.decl_class_type * string) option
  = "decl_folded_class_in_file_ffi"
```
Also refactor out some common utilities.

Differential Revision: D34605827

fbshipit-source-id: 3f555b10d1324e239c938569d632a78323e7a3eb
hphp/hack/src/rupro/decl_file.rs
hphp/hack/src/rupro/decl_folded_class_ffi.rs [new file with mode: 0644]
hphp/hack/src/rupro/decl_folded_class_rupro.ml [new file with mode: 0644]
hphp/hack/src/rupro/lib/folded_decl_provider/mod.rs
hphp/hack/src/rupro/lib/folded_decl_provider/provider.rs
hphp/hack/src/rupro/lib/pos/relative_path.rs