Skip to content

Commit

Permalink
Add labeled argument for Location_aux.included
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Apr 15, 2024
1 parent df12650 commit 3af2514
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/analysis/destruct.ml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ let rec get_every_pattern loc = function
begin
match
List.find_some ~f:(fun param ->
Location_aux.included_in param.Typedtree.fp_loc loc
Location_aux.included ~into:param.Typedtree.fp_loc loc
) params with
| Some pattern ->
(* In parameter case *)
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/parsing/location_aux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let compare_pos pos loc =
else
0

let included_in parent_loc child_loc =
let included ~into:parent_loc child_loc =
Lexing.compare_pos child_loc.loc_start parent_loc.loc_start >= 0 &&
Lexing.compare_pos parent_loc.loc_end child_loc.loc_end >= 0

Expand Down
4 changes: 2 additions & 2 deletions src/ocaml/parsing/location_aux.mli
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ val union : t -> t -> t
(** Like location_union, but keep loc_ghost'ness of first argument *)
val extend : t -> t -> t

(** [included_in parent child] returns [true] if [child] is included
(** [included ~into:parent child] returns [true] if [child] is included
in [parent]. Otherwise returns [false]. *)
val included_in : t -> t -> bool
val included : into:t -> t -> bool

(** Filter valid errors, log invalid ones *)
val prepare_errors : exn list -> Location.error list
Expand Down

0 comments on commit 3af2514

Please sign in to comment.