Move Nast -> decl functions into Decl_nast and Decl_folded_class modules
commitf5beb474b70cf82971638764fd588e678904941e
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Sat, 3 Oct 2020 23:10:12 +0000 (3 16:10 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 3 Oct 2020 23:12:29 +0000 (3 16:12 -0700)
treea49883babf05fb9034974a170352cef5e8cedcbf
parentb6ac55cfbad289acef06a6c28b628f73f669f9b1
Move Nast -> decl functions into Decl_nast and Decl_folded_class modules

Summary:
The Decl module provides functions which accept a Nast, convert it into a decl, and write that decl into shared memory. This is a problem for the migration to the direct decl parser, which produces a decl directly from source text. If we want to abstract over whether the direct decl parser is enabled, we will need to change these APIs so that they all accept a filename rather than an AST.

This diff does so--APIs accepting a filename are left in the Decl module, and APIs accepting a Nast (and their implementations) are moved to a new module, Decl_nast. The implementation of class-folding (i.e., producing a Decl_defs.decl_class_type) is move into another module, Decl_folded_class.

Reviewed By: shiqicao

Differential Revision: D24033149

fbshipit-source-id: 0c397daf509bb4d3a52503153ebd36214620b1fe
hphp/hack/src/decl/decl.ml
hphp/hack/src/decl/decl.mli
hphp/hack/src/decl/decl_folded_class.ml [copied from hphp/hack/src/decl/decl.ml with 71% similarity]
hphp/hack/src/decl/decl_folded_class.mli [new file with mode: 0644]
hphp/hack/src/decl/decl_nast.ml [new file with mode: 0644]
hphp/hack/src/decl/decl_nast.mli [new file with mode: 0644]
hphp/hack/src/decl/dune.inc
hphp/hack/src/hh_single_type_check.ml
hphp/hack/src/typing/dune
hphp/hack/src/typing/typing.ml