package comby

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

Environment

A match environment maps metavariables to values for a given match.

type t
val to_yojson : t -> Yojson.Safe.json
val of_yojson : Yojson.Safe.json -> (t, string) Core_kernel.Result.t
val create : unit -> t

create creates a new, empty environment

val vars : t -> string list

vars env returns all metavariables for this environment.

val add : ?range:range -> t -> string -> string -> t

add range env var value adds a metavariable var to env with value value and range range. If var already exists, this function has no effect and returns the existing environment.

val lookup : t -> string -> string option

lookup env ar returns the value assocated with a metavariable var.

val update : t -> string -> string -> t

update env var value updates the value of a metavariable var in env. If the metavariable does not exist, the entry is added.

val lookup_range : t -> string -> range option

lookup_range env var returns the range associated with metavariable var in env.

val update_range : t -> string -> range -> t

update_range env var value range updates env with the range associated with the value of var

val equal : t -> t -> bool
val copy : t -> t
val merge : t -> t -> t
val to_string : t -> string
val exists : t -> string -> bool