Delete dead code and add .mli docs to simplify/pascaligo.ml
This commit is contained in:
parent
c2489fd310
commit
fcfbbcb9c1
@ -8,7 +8,6 @@ open Combinators
|
|||||||
|
|
||||||
let nseq_to_list (hd, tl) = hd :: tl
|
let nseq_to_list (hd, tl) = hd :: tl
|
||||||
let npseq_to_list (hd, tl) = hd :: (List.map snd 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
|
let pseq_to_list = function
|
||||||
| None -> []
|
| None -> []
|
||||||
| Some lst -> npseq_to_list lst
|
| Some lst -> npseq_to_list lst
|
||||||
@ -36,16 +35,6 @@ module Errors = struct
|
|||||||
] in
|
] in
|
||||||
error ~data title message
|
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 unsupported_proc_decl decl =
|
||||||
let title () = "procedure declarations" in
|
let title () = "procedure declarations" in
|
||||||
let message () =
|
let message () =
|
||||||
@ -88,17 +77,6 @@ module Errors = struct
|
|||||||
] in
|
] in
|
||||||
error ~data title message
|
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 unsupported_string_catenation expr =
|
||||||
let title () = "string expressions" in
|
let title () = "string expressions" in
|
||||||
let message () =
|
let message () =
|
||||||
@ -110,16 +88,6 @@ module Errors = struct
|
|||||||
] in
|
] in
|
||||||
error ~data title message
|
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 unsupported_for_loops region =
|
||||||
let title () = "bounded iterators" in
|
let title () = "bounded iterators" in
|
||||||
let message () =
|
let message () =
|
||||||
|
14
src/passes/2-simplify/pascaligo.mli
Normal file
14
src/passes/2-simplify/pascaligo.mli
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user