package ppxlib

  1. Overview
  2. Docs
Standard infrastructure for ppx rewriters

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ppxlib-0.38.0.tbz
sha256=89e049b3102f6670a213d34d802ea3ab0fc530a8959d2f1a1e8db830063429a3
sha512=2fbbf124fc61e1f22242d13505e9af39d4a3c7cf03def1c33ee8bd915195be9b817636667302e9c6ceddc74a9a4a54926340e21c96fd770a2bc6752400315cfd

doc/src/ppxlib/ast_pattern0.ml.html

Source file ast_pattern0.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open! Import

exception Expected of Location.t * string

let fail loc expected = raise (Expected (loc, expected))

type context = {
  (* [matched] counts how many constructors have been matched. This is used to find what
     pattern matches the most some piece of ast in [Ast_pattern.alt]. In the case where
     all branches fail to match, we report the error from the one that matches the
     most.

     This is only incremented by combinators that can fail. *)
  mutable matched : int;
}

type ('matched_value, 'k, 'k_result) t =
  | T of (context -> Location.t -> 'matched_value -> 'k -> 'k_result)