ligo/src/main/compile/of_complex.ml
Pierre-Emmanuel Wulfman 2abd737ed3 compiling
2020-03-18 16:00:34 +01:00

26 lines
627 B
OCaml

open Trace
open Ast_complex
open Simplifier
type form =
| Contract of string
| Env
let compile (program : program) : Ast_simplified.program result =
simplify_program program
let compile_expression (e : expression) : Ast_simplified.expression result =
simplify_expression e
let pretty_print formatter (program : program) =
PP.program formatter program
let list_declarations (program : program) : string list =
List.fold_left
(fun prev el ->
let open Location in
match el.wrap_content with
| Declaration_constant (var,_,_,_) -> (Var.to_name var)::prev
| _ -> prev)
[] program