2017-11-02 18:57:17 +01:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2017-11-14 00:36:14 +01:00
|
|
|
(* Copyright (c) 2014 - 2017. *)
|
2017-11-02 18:57:17 +01:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2017-11-27 06:13:12 +01:00
|
|
|
open Tezos_micheline
|
|
|
|
|
2017-11-02 18:57:17 +01:00
|
|
|
(** The result of parsing and expanding a Michelson V1 script or data. *)
|
|
|
|
type parsed =
|
2017-11-13 14:29:28 +01:00
|
|
|
{
|
|
|
|
source : string ;
|
|
|
|
(** The original source code. *)
|
|
|
|
unexpanded : string Micheline.canonical ;
|
|
|
|
(** Original expression with macros. *)
|
|
|
|
expanded : Script.expr ;
|
|
|
|
(** Expression with macros fully expanded. *)
|
2017-11-02 18:57:17 +01:00
|
|
|
expansion_table :
|
|
|
|
(int * (Micheline_parser.location * int list)) list ;
|
2017-11-13 14:29:28 +01:00
|
|
|
(** Associates unexpanded nodes to their parsing locations and
|
|
|
|
the nodes expanded from it in the expanded expression. *)
|
|
|
|
unexpansion_table : (int * int) list ;
|
|
|
|
(** Associates an expanded node to its source in the unexpanded
|
|
|
|
expression. *)
|
|
|
|
}
|
2017-11-02 18:57:17 +01:00
|
|
|
|
2017-11-04 00:16:05 +01:00
|
|
|
val parse_toplevel : ?check:bool -> string -> parsed Micheline_parser.parsing_result
|
|
|
|
val parse_expression : ?check:bool -> string -> parsed Micheline_parser.parsing_result
|
2017-12-08 10:16:20 +01:00
|
|
|
val expand_all : source:string -> original:Micheline_parser.node -> parsed Micheline_parser.parsing_result
|