Up

module Ag_string_match

: sig
#
type position = [
| `Length
| `Position of int
| `End
]
#
type value = [
| `Int of int
| `Char of char
]
#
type 'a tree = [
| `Node of position * (value * 'a tree) list
| `Branch of (position * value) list * 'a tree
| `Leaf of 'a
]
#
val make_tree : (string * 'a) list -> 'a tree
#
type exit_with = [
| `Exn of string
| `Expr
]

`Exn s raises an exception for each failure branch, and this exception is caught in one place, avoiding duplication of the error_expr expression.

`Expr uses the error_expr in each failure branch, resulting in code duplication but avoiding raising and catching an exception. Suitable for fixed-length values for which code duplication is tolerable.

#
val make_ocaml_expr_factored : ?string_id:string -> ?pos_id:string -> ?len_id:string -> ?exit_with:exit_with -> error_expr:Ag_indent.t list -> (string * Ag_indent.t list) list -> Ag_indent.t list
#
val make_ocaml_expr_naive : ?string_id:string -> ?pos_id:string -> ?len_id:string -> error_expr:Ag_indent.t list -> (string * Ag_indent.t list) list -> Ag_indent.t list
#
val make_ocaml_expr : optimized:bool -> ?string_id:string -> ?pos_id:string -> ?len_id:string -> ?exit_with:exit_with -> error_expr:Ag_indent.t list -> (string * Ag_indent.t list) list -> Ag_indent.t list
#
val make_ocaml_int_mapping : ?string_id:string -> ?pos_id:string -> ?len_id:string -> ?exit_with:exit_with -> error_expr1:Ag_indent.t list -> ?error_expr2:Ag_indent.t list -> ?int_id:string -> (string * Ag_indent.t list) list -> Ag_indent.t list * Ag_indent.t list
end