Skip to content

Commit

Permalink
refactor(engine): complete cleanup of ast_utils
Browse files Browse the repository at this point in the history
AST utils used to be one monolithic file without good organization and
with no documentation at all.

This commit drops `ast_utils.ml` in favor of `ast_utils/*` modules,
and reoganize things.

I intend on documenting everything in `ast_utils/*`.
  • Loading branch information
W95Psp committed Jan 23, 2024
1 parent b938d4f commit 388c250
Show file tree
Hide file tree
Showing 26 changed files with 1,208 additions and 1,177 deletions.
2 changes: 1 addition & 1 deletion engine/lib/analyses/function_dependency.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module%inlined_contents Make (F : Features.T) = struct
Ast_utils.MakeWithNamePolicy (F) (Concrete_ident.DefaultNamePolicy)

let analyse (items : A.item list) : analysis_data =
let temp_list = List.concat_map ~f:U.functions_of_item items in
let temp_list = List.concat_map ~f:U.Destruct.Item.functions items in
List.fold_left
~init:(Map.empty (module String))
~f:(fun y (name, body) ->
Expand Down
2 changes: 1 addition & 1 deletion engine/lib/analyses/mutable_variables.ml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ module%inlined_contents Make (F : Features.T) = struct
~f:(fun (y, count) (name, body) ->
let items, count = analyse_function_body body count in
(y @ [ (name, items) ], count))
(List.concat_map ~f:U.functions_of_item items)
(List.concat_map ~f:U.Destruct.Item.functions items)
in
let mut_map (* Concrete_ident *) :
(Local_ident.t list * (U.TypedLocalIdent.t * id_order) list)
Expand Down
2 changes: 1 addition & 1 deletion engine/lib/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ functor
(s : string) : item =
{ v = HaxError s; span; ident; attrs = [] }

module F = F
(* module F = F *)
end

module type T = sig
Expand Down
Loading

0 comments on commit 388c250

Please sign in to comment.