package patdiff

  1. Overview
  2. Docs
include module type of struct include Patdiff_kernel.Patdiff_core end
val default_context : int
val default_line_big_enough : int
val default_word_big_enough : int
val remove_ws : string -> string

remove_ws calls String.strip and replaces whitespace with " "

include Patdiff_kernel.Patdiff_core.S
val diff : context:int -> line_big_enough:int -> keep_ws:bool -> prev:string array -> next:string array -> Patdiff_kernel.Hunks.t

diff ~context ~keep_ws ~prev ~next uses Patience_diff.String to get a list of hunks describing the comparison between prev and next.

val refine : rules:Patdiff_kernel.Format.Rules.t -> produce_unified_lines:bool -> output:Patdiff_kernel.Output.t -> keep_ws:bool -> split_long_lines:bool -> interleave:bool -> word_big_enough:int -> Patdiff_kernel.Hunks.t -> Patdiff_kernel.Hunks.t

refine hunks maps each Range.Replace (prev, next) in hunks to a diff of prev against next.

val explode : string array -> keep_ws:bool -> [ `Newline of int * string option | `Word of string ] array

Print a hunk list, usually from diff or refine

val output_to_string : ?print_global_header:bool -> file_names:(Patdiff_kernel.File_name.t * Patdiff_kernel.File_name.t) -> rules:Patdiff_kernel.Format.Rules.t -> output:Patdiff_kernel.Output.t -> location_style:Patdiff_kernel.Format.Location_style.t -> Patdiff_kernel.Hunks.t -> string

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

val iter_ansi : rules:Patdiff_kernel.Format.Rules.t -> f_hunk_break:((int * int) -> (int * int) -> unit) -> f_line:(string -> unit) -> Patdiff_kernel.Hunks.t -> 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

val patdiff : ?context:int -> ?keep_ws:bool -> ?rules:Patdiff_kernel.Format.Rules.t -> ?output:Patdiff_kernel.Output.t -> ?produce_unified_lines:bool -> ?split_long_lines:bool -> ?print_global_header:bool -> ?location_style:Patdiff_kernel.Format.Location_style.t -> ?interleave:bool -> ?line_big_enough:int -> ?word_big_enough:int -> prev:Patdiff_kernel.Diff_input.t -> next:Patdiff_kernel.Diff_input.t -> unit -> string

Runs the equivalent of the command line version of patdiff on two given contents prev and next. Uses Patience_diff.String.