package tezos-protocol-005-PsBABY5H

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Default annotations

val default_now_annot : Script_typed_ir.var_annot option
val default_amount_annot : Script_typed_ir.var_annot option
val default_balance_annot : Script_typed_ir.var_annot option
val default_steps_annot : Script_typed_ir.var_annot option
val default_source_annot : Script_typed_ir.var_annot option
val default_sender_annot : Script_typed_ir.var_annot option
val default_self_annot : Script_typed_ir.var_annot option
val default_arg_annot : Script_typed_ir.var_annot option
val default_param_annot : Script_typed_ir.var_annot option
val default_storage_annot : Script_typed_ir.var_annot option
val default_car_annot : Script_typed_ir.field_annot option
val default_cdr_annot : Script_typed_ir.field_annot option
val default_contract_annot : Script_typed_ir.field_annot option
val default_addr_annot : Script_typed_ir.field_annot option
val default_manager_annot : Script_typed_ir.field_annot option
val default_pack_annot : Script_typed_ir.field_annot option
val default_unpack_annot : Script_typed_ir.field_annot option
val default_slice_annot : Script_typed_ir.field_annot option
val default_elt_annot : Script_typed_ir.field_annot option
val default_key_annot : Script_typed_ir.field_annot option
val default_hd_annot : Script_typed_ir.field_annot option
val default_tl_annot : Script_typed_ir.field_annot option
val default_some_annot : Script_typed_ir.field_annot option
val default_left_annot : Script_typed_ir.field_annot option
val default_right_annot : Script_typed_ir.field_annot option
val default_binding_annot : Script_typed_ir.field_annot option

Unparse annotations to their string representation

val unparse_type_annot : Script_typed_ir.type_annot option -> string list
val unparse_var_annot : Script_typed_ir.var_annot option -> string list
val unparse_field_annot : Script_typed_ir.field_annot option -> string list

Convertions functions between different annotation kinds

val field_to_var_annot : Script_typed_ir.field_annot option -> Script_typed_ir.var_annot option
val type_to_var_annot : Script_typed_ir.type_annot option -> Script_typed_ir.var_annot option
val var_to_field_annot : Script_typed_ir.var_annot option -> Script_typed_ir.field_annot option
val default_annot : default:'a option -> 'a option -> 'a option

Replace an annotation by its default value if it is None

val gen_access_annot : Script_typed_ir.var_annot option -> ?default:Script_typed_ir.field_annot option -> Script_typed_ir.field_annot option -> Script_typed_ir.var_annot option

Generate annotation for field accesses, of the form var.field1.field2

val merge_type_annot : legacy:bool -> Script_typed_ir.type_annot option -> Script_typed_ir.type_annot option -> (Script_typed_ir.type_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Merge type annotations.

  • returns

    an error Inconsistent_type_annotations if they are both present and different, unless legacy

val merge_field_annot : legacy:bool -> Script_typed_ir.field_annot option -> Script_typed_ir.field_annot option -> (Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Merge field annotations.

  • returns

    an error Inconsistent_type_annotations if they are both present and different, unless legacy

val merge_var_annot : Script_typed_ir.var_annot option -> Script_typed_ir.var_annot option -> Script_typed_ir.var_annot option

Merge variable annotations, does not fail (None if different).

val error_unexpected_annot : int -> 'a list -> (unit, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result
  • returns

    an error Unexpected_annotation in the monad the list is not empty.

val fail_unexpected_annot : int -> 'a list -> (unit, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result Lwt.t

Same as error_unexpected_annot in Lwt.

val parse_type_annot : int -> string list -> (Script_typed_ir.type_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Parse a type annotation only.

val parse_field_annot : int -> string list -> (Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Parse a field annotation only.

val parse_type_field_annot : int -> string list -> (Script_typed_ir.type_annot option * Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Parse an annotation for composed types, of the form :ty_name %field in any order.

val parse_composed_type_annot : int -> string list -> (Script_typed_ir.type_annot option * Script_typed_ir.field_annot option * Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Parse an annotation for composed types, of the form :ty_name %field1 %field2 in any order.

val extract_field_annot : Alpha_context.Script.node -> (Alpha_context.Script.node * Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Extract and remove a field annotation from a node

val check_correct_field : Script_typed_ir.field_annot option -> Script_typed_ir.field_annot option -> (unit, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Check that field annotations match, used for field accesses.

Instruction annotations parsing

val parse_var_annot : int -> ?default:Script_typed_ir.var_annot option -> string list -> (Script_typed_ir.var_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result

Parse a variable annotation, replaced by a default value if None.

val parse_constr_annot : int -> ?if_special_first:Script_typed_ir.field_annot option -> ?if_special_second:Script_typed_ir.field_annot option -> string list -> (Script_typed_ir.var_annot option * Script_typed_ir.type_annot option * Script_typed_ir.field_annot option * Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result
val parse_two_var_annot : int -> string list -> (Script_typed_ir.var_annot option * Script_typed_ir.var_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result
val parse_destr_annot : int -> string list -> default_accessor:Script_typed_ir.field_annot option -> field_name:Script_typed_ir.field_annot option -> pair_annot:Script_typed_ir.var_annot option -> value_annot:Script_typed_ir.var_annot option -> (Script_typed_ir.var_annot option * Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result
val parse_entrypoint_annot : int -> ?default:Script_typed_ir.var_annot option -> string list -> (Script_typed_ir.var_annot option * Script_typed_ir.field_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result
val parse_var_type_annot : int -> string list -> (Script_typed_ir.var_annot option * Script_typed_ir.type_annot option, Tezos_protocol_environment_005_PsBABY5H__Environment.Error_monad.error list) Stdlib.result
OCaml

Innovation. Community. Security.