(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(** Compute the diff between two Pp.t structures and return
versions of each with diffs highlighted as (old, new) *) val diff_pp : ?tokenize_string:(string -> stringlist) -> Pp.t -> Pp.t -> Pp.t * Pp.t
(** Compute the diff between two Pp.t structures and return ahighlightedPp.t.If[show_removed]istrue,showseparatelinesfor
removals and additions, otherwise only show additions *) val diff_pp_combined : ?tokenize_string:(string -> stringlist) -> ?show_removed:bool -> Pp.t -> Pp.t -> Pp.t
(** Raised if the diff fails *)
exception Diff_Failure ofstring
module StringDiff : sig type elem = String.t type t = elem array end
type diff_type =
[ `Removed
| `Added
| `Common
]
type diff_list = StringDiff.elem Diff2.edit list
(** Compute the difference between 2 strings in terms of tokens, using the lexertoidentifytokens.
Thereforeyoushouldcatchanyexceptions.Theworkaroundfornowisforthe callertotokenizethestringsitselfandthencalldiff_strs.
*) val diff_str : ?tokenize_string:(string -> stringlist) -> string -> string -> StringDiff.elem Diff2.edit list
(** Compute the differences between 2 lists of strings, treating the strings inthelistsasindivisibleunits.
*) val diff_strs : StringDiff.t -> StringDiff.t -> StringDiff.elem Diff2.edit list
(** Generate a new Pp that adds tags marking diffs to a Pp structure: which:either`Addedor`Removed,indicateswhichtypeofdiffstoadd pp:theoriginalstructure.For`Added,mustbethenewpppassedtodiff_pp For`Removed,mustbetheoldpppassedtodiff_pp.Passingthewrongone willlikelyraiseDiff_Failure. diffs:thedifflistreturnedbydiff_pp
Undersome"impossible"conditions,thisroutinemayraiseDiff_Failure. Ifyouwanttomakeyourcallespeciallybulletproof,catchthis exception,printauser-visiblemessage,thenrecallthisroutinewith thefirstargumentsettoNone,whichwillskipthediff.
*) val add_diff_tags : diff_type -> Pp.t -> StringDiff.elem Diff2.edit list -> Pp.t
(** Returns a boolean pair (added, removed) for [diffs] where a true value indicatesthatsomethingwasadded/removedinthediffs.
*) val has_changes : diff_list -> bool * bool
val get_dinfo : StringDiff.elem Diff2.edit -> diff_type * string
(** Returns a modified [pp] with the background highlighted with "start.<diff_tag>.bg"and"end.<diff_tag>.bg"tagsatthebeginning andendofthereturnedPp.t
*) val wrap_in_bg : string -> Pp.t -> Pp.t
(** Displays the diffs to a printable format for debugging *) val string_of_diffs : diff_list -> string
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.