Module Patdiff_lib.Patdiff_core

module Format : module type of sig ... end
module Output : module type of sig ... end
val default_context : int
val diff : context:int ‑> keep_ws:bool ‑> mine:string array ‑> other:string array ‑> string Import.Patience_diff.Hunk.t list

diff ~context ~keep_ws ~mine ~other uses Patience_diff to get a list of hunks describing the comparison between mine and other.

val remove_ws : string ‑> string
val refine : rules:Format.Rules.t ‑> produce_unified_lines:bool ‑> output:Output.t ‑> keep_ws:bool ‑> split_long_lines:bool ‑> string Import.Patience_diff.Hunk.t list ‑> string Import.Patience_diff.Hunk.t list

refine ~rules ~producte_unified_lines ~output ~keep_ws ~split_long_lines hunks takes the Replace ranges from hunks, splits them into smaller arrays, diffs those arrays, formats them according to rules, and recomposes the Replace range of hunks.

val print : old_file:string ‑> new_file:string ‑> rules:Format.Rules.t ‑> output:Output.t ‑> location_style:Format.Location_style.t ‑> string Import.Patience_diff.Hunk.t list ‑> unit

Print a hunk list, usually from diff or refine

val output_to_string : ?print_global_header:bool ‑> file_names:(string * string) ‑> rules:Format.Rules.t ‑> output:Output.t ‑> location_style:Format.Location_style.t ‑> string Import.Patience_diff.Hunk.t list ‑> string

Output a hunk list, usually from diff or refine, to a string

val iter_ansi : rules:Format.Rules.t ‑> f_hunk_break:((int * int) ‑> (int * int) ‑> unit) ‑> f_line:(string ‑> unit) ‑> string Import.Patience_diff.Hunk.t list ‑> unit

Iter along the lines of the diff and the breaks between hunks. Offers more flexibility regarding what the caller wants to do with the lines

type diff_input = {
name : string;
text : string;
}
val patdiff : ?context:int ‑> ?keep_ws:bool ‑> ?rules:Format.Rules.t ‑> ?output:Output.t ‑> ?produce_unified_lines:bool ‑> ?split_long_lines:bool ‑> ?print_global_header:bool ‑> ?location_style:Format.Location_style.t ‑> from_:diff_input ‑> to_:diff_input ‑> unit ‑> string

Runs the equivalent of the command line version of patdiff on two given contents from_ and to_.