Derive `mapreduce` visitor for the AAST
commit3f12c1cf464a3292f267f5fd18bef7cf2c1f6bc6
authorMichael Thomas <mjt@meta.com>
Sun, 6 Nov 2022 17:44:29 +0000 (6 09:44 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sun, 6 Nov 2022 17:44:29 +0000 (6 09:44 -0800)
treee84a7b14f82d93427c0b13527c15a1c0eb5b16d2
parent5b00f1fd1de17f8cfc2e810b192b220eb0894797
Derive `mapreduce` visitor for the AAST

Summary:
`mapreduce` lets us `fold_map` over the AAST.

This is exactly what we want to do in a _validating elaboration phase_ such as naming where we rewrite hints to canonical form and accumulate errors (at the moment errors are a side-effect *but* we'd like to collect and manipulate them)

I'll use the new visitor to break apart and reimplement the OCaml naming phase before moving to Rust

Differential Revision: D40759727

fbshipit-source-id: a205b126c3586f19a3a85b0a0248287e7749532f
hphp/hack/src/annotated_ast/aast_defs.ml
hphp/hack/src/annotated_ast/aast_defs_visitors_ancestors.ml
hphp/hack/src/ast/ast_defs.ml
hphp/hack/src/oxidized/gen/aast_defs.rs
hphp/hack/src/oxidized/gen/ast_defs.rs
hphp/hack/src/oxidized_by_ref/gen/aast_defs.rs
hphp/hack/src/utils/visitors_runtime.ml