Module Ppx_core__.Code_matcher

Match source code against generated code

val match_structure : pos:Lexing.position ‑> expected:Ppx_core__.Import.structure ‑> mismatch_handler:(Ppx_core.Location.t ‑> Ppx_core__.Import.structure ‑> Ppx_core__.Import.unit) ‑> Ppx_core__.Import.structure ‑> Ppx_core__.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:Lexing.position ‑> expected:Ppx_core__.Import.signature ‑> mismatch_handler:(Ppx_core.Location.t ‑> Ppx_core__.Import.signature ‑> Ppx_core__.Import.unit) ‑> Ppx_core__.Import.signature ‑> Ppx_core__.Import.unit

Same for signatures