Module Ppxlib__Code_matcher

Match source code against generated code

val match_structure : pos:Stdlib.Lexing.position -> expected:Ppxlib__.Import.structure -> mismatch_handler:(Ppxlib.Location.t -> Ppxlib__.Import.structure -> Ppxlib__.Import.unit) -> Ppxlib__.Import.structure -> Ppxlib__.Import.unit

Checks that the given code starts with expected followed by @@@deriving.end or @@@end.

Raises if there is no @@@deriving.end.

If some items don't match, it calls mismatch_handler with the location of the source items and the expected code.

val match_signature : pos:Stdlib.Lexing.position -> expected:Ppxlib__.Import.signature -> mismatch_handler:(Ppxlib.Location.t -> Ppxlib__.Import.signature -> Ppxlib__.Import.unit) -> Ppxlib__.Import.signature -> Ppxlib__.Import.unit

Same for signatures