ligo/src/passes/01-parsing/reasonligo.mli

26 lines
991 B
OCaml
Raw Normal View History

(** This file provides an interface to the ReasonLIGO parser. *)
open Trace
2020-06-12 14:58:38 +04:00
module CST = Cst.Cameligo
(** Open a ReasonLIGO filename given by string and convert into an
abstract syntax tree. *)
2020-06-12 14:58:38 +04:00
val parse_file : string -> (CST.t , Errors.parser_error) result
(** Convert a given string into a ReasonLIGO abstract syntax tree *)
2020-06-12 14:58:38 +04:00
val parse_string : string -> (CST.t , Errors.parser_error) result
(** Parse a given string as a ReasonLIGO expression and return an
2020-06-12 14:58:38 +04:00
expression CST.
This is intended to be used for interactive interpreters, or other
scenarios where you would want to parse a ReasonLIGO expression
outside of a contract. *)
2020-06-12 14:58:38 +04:00
val parse_expression : string -> (CST.expr , Errors.parser_error) result
(** Preprocess a given ReasonLIGO file and preprocess it. *)
val preprocess : string -> (Buffer.t , Errors.parser_error) result
(** Pretty-print a given CameLIGO file (after parsing it). *)
val pretty_print : string -> (Buffer.t , Errors.parser_error) result