Remove from_text from full_fidelity_ast
commitc907f49a9bcc4ae69a49e03e01359e37369e2556
authorThomas Jiang <thomasjiang@fb.com>
Tue, 8 Oct 2019 00:00:38 +0000 (7 17:00 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 8 Oct 2019 00:02:35 +0000 (7 17:02 -0700)
tree0d77bca06e9cbb740d9b863144eade3c0f8eefca
parentf63c48b4718e0855bb556c49d6869e894f942da4
Remove from_text from full_fidelity_ast

Summary:
When the parser is rustified, the legacy ast should hopefully disappear along with it. So I am trying to front run some of that work by removing existing references to the legacy by containing them to an implementation detail in lowering in full_fidelity_ast and removing calls that expose the legacy ast in the mli file. That way, when the lowerer is ported and goes straight to the aast, it can just be a drop in for everything.

This diff removes `from_text` from the interface and attempts to replace it with a `from_text_to_empty_tast` function that provides the functionality for `hh_single_compile` to take a file and get an untyped tast.

Some tests were modified:

Tests previously printing out the legacy ast now print out the equivalent aast.
Tests that previously had codepaths with trait resolution (`insteadof`) (`use as`) were deleted as those are php features that Hack does not support.

Reviewed By: shiqicao

Differential Revision: D17695710

fbshipit-source-id: ae7ad41851b88e04e3b4039b5fb1f8fe6d94ad72
hphp/hack/src/hh_single_compile.ml
hphp/hack/src/parser/dune.inc
hphp/hack/src/parser/full_fidelity_ast.ml
hphp/hack/src/parser/full_fidelity_ast.mli
hphp/hack/src/providers/ast_provider.ml
hphp/hack/src/typing/dune
hphp/hack/test/rust/rust_ocaml_test.ml