package comby

  1. Overview
  2. Docs
On This Page
  1. Pipeline
Legend:
Library
Module
Module type
Parameter
Class
Class type

Pipeline

Exposes top level functions for running matchers and generating replacements. For finer control over matching and rewriting, use Matcher.all to generate matches, and then process matches with Rewrite functions.

type single_source =
  1. | Path of string
  2. | String of string

Source inputs for a pipeline is either a string, or a file path.

module Specification : sig ... end
type specification = Specification.t
type output =
  1. | Matches of match' list * int
  2. | Replacement of Replacement.t list * string * int
  3. | Nothing

The output of running a specification. Matches are a list of matches and the number of matches found. A Replacement consists of the list of replacement fragments, the rewrite output, and the number of replacements made.

val execute : (module Matchers.Matcher.S) -> ?substitute_in_place:bool -> ?timeout:int -> ?metasyntax:Matchers.metasyntax -> ?fresh:(unit -> string) -> ?configuration:Matchers.configuration -> single_source -> specification -> output

execute matcher subst timeout metasyntax fresh config source spec runs a matcher on source for spec parameterized by config. subst sets whether rewrite output should substitute rewritten values in place. timeout specifies a timeout in seconds (default 3). If metasyntax is defined, rewrite operations will respect custom metasyntax definitions. Note that metasyntax here does not affect matching: matcher should be defined with a metasyntax definition if desired. A custom fresh variable generator may supply values to use for substitution; see Rewrite.substitute for more.

OCaml

Innovation. Community. Security.