Splitting off the type definition of parse trees
commit93261f97c94658f49720b3c95c32351e2166b2eb
authorPhilip Hölzenspies <drphil@fb.com>
Tue, 30 May 2017 14:36:33 +0000 (30 07:36 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 30 May 2017 14:54:37 +0000 (30 07:54 -0700)
treed2aee251b58c95cac03788b7b913a9781e980b29
parent5aaa93216e93c8f64b5a9f93beecad049d3f81f8
Splitting off the type definition of parse trees

Summary: By having the type definition in its own module, we can include it seperately in different `.ml` and `.mli` files. When we want to be sure that all cases are covered in a match, for example (think about the formatter or the lowerer), it helps to not use predicates, but to pattern match directly on structure. To this end, we need access to the internals of the type. Since "PositionedSyntax" et al already export their structure, it seems we were already there, but in developing the validation (few diffs up this stack), it turned out to be cumbersome to not have the parametric case.

Reviewed By: kmeht

Differential Revision: D5121343

fbshipit-source-id: b06d19638a66b8b1cbd8a2e1817ad6a118e3a84a
hphp/hack/src/generate_full_fidelity.ml
hphp/hack/src/parser/full_fidelity_syntax.ml
hphp/hack/src/parser/full_fidelity_syntax_type.ml [new file with mode: 0644]