diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 31e739f36..1d5f1b89b 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -8,7 +8,6 @@ open Combinators let nseq_to_list (hd, tl) = hd :: tl let npseq_to_list (hd, tl) = hd :: (List.map snd tl) -let npseq_to_nelist (hd, tl) = hd, (List.map snd tl) let pseq_to_list = function | None -> [] | Some lst -> npseq_to_list lst @@ -36,16 +35,6 @@ module Errors = struct ] in error ~data title message - let bad_bytes loc str = - let title () = "bad bytes string" in - let message () = - Format.asprintf "bytes string contained non-hexadecimal chars" in - let data = [ - ("location", fun () -> Format.asprintf "%a" Location.pp loc) ; - ("bytes", fun () -> str) ; - ] in - error ~data title message - let unsupported_proc_decl decl = let title () = "procedure declarations" in let message () = @@ -88,17 +77,6 @@ module Errors = struct ] in error ~data title message - let unsupported_arith_op expr = - let title () = "arithmetic expressions" in - let message () = - Format.asprintf "this arithmetic operator is not supported yet" in - let expr_loc = Raw.expr_to_region expr in - let data = [ - ("expr_loc", - fun () -> Format.asprintf "%a" Location.pp_lift @@ expr_loc) - ] in - error ~data title message - let unsupported_string_catenation expr = let title () = "string expressions" in let message () = @@ -110,16 +88,6 @@ module Errors = struct ] in error ~data title message - let unsupported_proc_calls call = - let title () = "procedure calls" in - let message () = - Format.asprintf "procedure calls are not supported yet" in - let data = [ - ("call_loc", - fun () -> Format.asprintf "%a" Location.pp_lift @@ call.Region.region) - ] in - error ~data title message - let unsupported_for_loops region = let title () = "bounded iterators" in let message () = diff --git a/src/passes/2-simplify/pascaligo.mli b/src/passes/2-simplify/pascaligo.mli new file mode 100644 index 000000000..ebce134d6 --- /dev/null +++ b/src/passes/2-simplify/pascaligo.mli @@ -0,0 +1,14 @@ +(** Converts PascaLIGO programs to the Simplified Abstract Syntax Tree. *) + +open Ast_simplified + +module Raw = Parser.Pascaligo.AST +module SMap = Map.String + +(** Convert a concrete PascaLIGO expression AST to the simplified expression AST + used by the compiler. *) +val simpl_expression : Raw.expr -> expression Trace.result + +(** Convert a concrete PascaLIGO program AST to the simplified program AST used + by the compiler. *) +val simpl_program : Raw.ast -> program Trace.result