From 95bcff82997f107110cfa8c0cbf2475a388845c4 Mon Sep 17 00:00:00 2001 From: George Zahariev Date: Thu, 20 Feb 2025 13:01:55 -0800 Subject: [PATCH] [flow] Rename run_opt_loc to run_loc_opt to match map_loc_opt Summary: Rename `run_opt_loc` (from `Flow_ast_visitor`) to `run_loc_opt` to match `map_loc_opt` (from `Flow_ast_mapper`). Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D69936255 fbshipit-source-id: 23a12d63a9e9b8e80212001b7bdfa720193fbd6b --- src/analysis/env_builder/find_providers.ml | 6 +++--- src/parser_utils/flow_ast_visitor.ml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/analysis/env_builder/find_providers.ml b/src/analysis/env_builder/find_providers.ml index f821a27b533..06a9d6f2c09 100644 --- a/src/analysis/env_builder/find_providers.ml +++ b/src/analysis/env_builder/find_providers.ml @@ -666,7 +666,7 @@ end = struct let env2 = this#accumulate_branch_env (env0, cx) - (fun () -> run_opt_loc this#if_alternate_statement alternate) + (fun () -> run_loc_opt this#if_alternate_statement alternate) env1 in this#set_acc (env2, cx); @@ -703,11 +703,11 @@ end = struct let env' = this#accumulate_branch_env (env0, cx) - (fun () -> run_opt_loc this#catch_clause handler) + (fun () -> run_loc_opt this#catch_clause handler) env' in let env' = - this#accumulate_branch_env (env0, cx) (fun () -> run_opt_loc this#block finalizer) env' + this#accumulate_branch_env (env0, cx) (fun () -> run_loc_opt this#block finalizer) env' in this#set_acc (env', cx); stmt diff --git a/src/parser_utils/flow_ast_visitor.ml b/src/parser_utils/flow_ast_visitor.ml index b056578e54a..2b355381c16 100644 --- a/src/parser_utils/flow_ast_visitor.ml +++ b/src/parser_utils/flow_ast_visitor.ml @@ -13,7 +13,7 @@ let run_opt : 'node. ('node -> 'node) -> 'node option -> unit = let run_loc : ('loc -> 'node -> 'node) -> 'loc * 'node -> unit = (fun visit (loc, node) -> ignore @@ visit loc node) -let run_opt_loc : ('loc -> 'node -> 'node) -> ('loc * 'node) option -> unit = +let run_loc_opt : ('loc -> 'node -> 'node) -> ('loc * 'node) option -> unit = (fun visit -> Base.Option.iter ~f:(fun (loc, node) -> ignore @@ visit loc node)) let run_list : 'node. ('node -> 'node) -> 'node list -> unit = (fun visit -> List.iter (run visit))