package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

doc/octez-libs.micheline/Tezos_micheline/Micheline/index.html

Module Tezos_micheline.MichelineSource

Sourcetype annot = string list
Sourcetype ('l, 'p) node =
  1. | Int of 'l * Z.t
  2. | String of 'l * string
  3. | Bytes of 'l * Bytes.t
  4. | Prim of 'l * 'p * ('l, 'p) node list * annot
  5. | Seq of 'l * ('l, 'p) node list

The abstract syntax tree of Micheline expressions. The first parameter is used to contain locations, but can also embed custom data. The second parameter is the type of primitive names.

Sourceval location : ('l, 'p) node -> 'l

Extract the location of the node.

Sourceval annotations : ('l, 'p) node -> string list

Extract the annotations of the node.

Sourcetype 'p canonical

Expression form using canonical integer numbering as locations. The root has number zero, and each node adds one in the order of infix traversal. To be used when locations are not important, or when one wants to attach properties to nodes in an expression without rewriting it (using an indirection table with canonical locations as keys).

Sourcetype canonical_location = int

Canonical integer locations that appear inside canonical expressions.

Sourceval dummy_location : canonical_location

A location that won't exist in any well-formed canonical value

Sourceval strip_locations : (_, 'p) node -> 'p canonical

Compute the canonical form of an expression. Drops the concrete locations completely.

Sourceval root : 'p canonical -> (canonical_location, 'p) node

Give the root node of an expression in canonical form.

Sourceval extract_locations : ('l, 'p) node -> 'p canonical * (canonical_location * 'l) list

Compute the canonical form of an expression. Saves the concrete locations in an association list.

Sourceval inject_locations : (canonical_location -> 'l) -> 'p canonical -> ('l, 'p) node

Transforms an expression in canonical form into a polymorphic one. Takes a mapping function to inject the concrete locations.

Sourceval map : ('a -> 'b) -> 'a canonical -> 'b canonical

Copies the tree, updating its primitives.

Sourceval map_node : ('la -> 'lb) -> ('pa -> 'pb) -> ('la, 'pa) node -> ('lb, 'pb) node

Copies the tree, updating its primitives and locations.

OCaml

Innovation. Community. Security.