package comby

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

Rule

Defines types and operations for match rules.

type t = Ast.expression list
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
type options = {
  1. nested : bool;
}
val create : ?metasyntax:metasyntax -> ?external_handler:External.t -> string -> t Core_kernel.Or_error.t
val options : t -> options
type result
val sat : result -> bool

sat result returns true if a result of a rule is satisfied.

val result_env : result -> Match.environment option
val apply : ?substitute_in_place:bool -> ?metasyntax:Metasyntax.t -> ?external_handler:External.t -> ?filepath:string -> match_all: (?configuration:Configuration.t -> ?filepath:string -> template:string -> source:string -> unit -> Match.t list) -> Ast.expression list -> Match.Environment.t -> result

apply matcher substitute_in_place fresh metasyntax rule env applies a rule according to some matcher for existing matches in env. If substitute_in_place is true, rewrite rules substitute their values in place (default true). fresh introduces fresh variables for evaluating rules. metasyntax uses the custom metasyntax definition.

OCaml

Innovation. Community. Security.