Module Mavryk_client_alpha.Michelson_v1_parser

type 'prim parser_result = {
  1. source : string;
    (*

    The original source code.

    *)
  2. unexpanded : string Mavryk_micheline.Micheline.canonical;
    (*

    Original expression with macros.

    *)
  3. expanded : 'prim Mavryk_micheline.Micheline.canonical;
    (*

    Expression with macros fully expanded.

    *)
  4. expansion_table : (int * (Mavryk_micheline.Micheline_parser.location * int list)) list;
    (*

    Associates unexpanded nodes to their parsing locations and the nodes expanded from it in the expanded expression.

    *)
  5. unexpansion_table : (int * int) list;
    (*

    Associates an expanded node to its source in the unexpanded expression.

    *)
}

The result of parsing and expanding a Michelson V1 script or data.

val compare_parsed : parsed -> parsed -> int
val parse_toplevel : ?check:bool -> string -> parsed Mavryk_micheline.Micheline_parser.parsing_result
val expand_toplevel : ?check:bool -> string -> string parser_result Mavryk_micheline.Micheline_parser.parsing_result

Same as parse_toplevel but skips the final step (recognizing the primitives).

val parse_expression : ?check:bool -> string -> parsed Mavryk_micheline.Micheline_parser.parsing_result
val expand_expression : ?check:bool -> string -> string parser_result Mavryk_micheline.Micheline_parser.parsing_result

Same as parse_expression but skips the final step (recognizing the primitives).

val expand_all_and_recognize_prims : source:string -> original:Mavryk_micheline.Micheline_parser.node -> parsed Mavryk_micheline.Micheline_parser.parsing_result
val unrecognize_prims : parsed -> string parser_result