diff --git a/src/main/compile/dune b/src/main/compile/dune new file mode 100644 index 000000000..bd1ac2d33 --- /dev/null +++ b/src/main/compile/dune @@ -0,0 +1,21 @@ +(library + (name compile) + (public_name ligo.compile) + (libraries + simple-utils + tezos-utils + parser + simplify + ast_simplified + typer + ast_typed + transpiler + mini_c + operators + compiler + ) + (preprocess + (pps ppx_let) + ) + (flags (:standard -w +1..62-4-9-44-40-42-48-30@39@33 -open Simple_utils -open Tezos_utils )) +) diff --git a/src/main/compile/helpers.ml b/src/main/compile/helpers.ml new file mode 100644 index 000000000..5e47665a4 --- /dev/null +++ b/src/main/compile/helpers.ml @@ -0,0 +1,72 @@ +open Trace + +type s_syntax = Syntax_name of string +type v_syntax = Pascaligo | Cameligo + +let syntax_to_variant : s_syntax -> string option -> v_syntax result = + fun syntax source_filename -> + let subr s n = + String.sub s (String.length s - n) n in + let endswith s suffix = + let suffixlen = String.length suffix in + ( String.length s >= suffixlen + && String.equal (subr s suffixlen) suffix) + in + let (Syntax_name syntax) = syntax in + match (syntax , source_filename) with + | "auto" , Some sf when endswith sf ".ligo" -> ok Pascaligo + | "auto" , Some sf when endswith sf ".mligo" -> ok Cameligo + | "auto" , _ -> simple_fail "cannot auto-detect syntax, pleas use -s name_of_syntax" + | "pascaligo" , _ -> ok Pascaligo + | "cameligo" , _ -> ok Cameligo + | _ -> simple_fail "unrecognized parser" + +let parsify_pascaligo = fun source -> + let%bind raw = + trace (simple_error "parsing") @@ + Parser.Pascaligo.parse_file source in + let%bind simplified = + trace (simple_error "simplifying") @@ + Simplify.Pascaligo.simpl_program raw in + ok simplified + +let parsify_expression_pascaligo = fun source -> + let%bind raw = + trace (simple_error "parsing expression") @@ + Parser.Pascaligo.parse_expression source in + let%bind simplified = + trace (simple_error "simplifying expression") @@ + Simplify.Pascaligo.simpl_expression raw in + ok simplified + +let parsify_ligodity = fun source -> + let%bind raw = + trace (simple_error "parsing") @@ + Parser.Ligodity.parse_file source in + let%bind simplified = + trace (simple_error "simplifying") @@ + Simplify.Ligodity.simpl_program raw in + ok simplified + +let parsify_expression_ligodity = fun source -> + let%bind raw = + trace (simple_error "parsing expression") @@ + Parser.Ligodity.parse_expression source in + let%bind simplified = + trace (simple_error "simplifying expression") @@ + Simplify.Ligodity.simpl_expression raw in + ok simplified + +let parsify = fun (syntax : v_syntax) source_filename -> + let%bind parsify = match syntax with + | Pascaligo -> ok parsify_pascaligo + | Cameligo -> ok parsify_ligodity + in + parsify source_filename + +let parsify_expression = fun syntax source -> + let%bind parsify = match syntax with + | Pascaligo -> ok parsify_expression_pascaligo + | Cameligo -> ok parsify_expression_ligodity + in + parsify source diff --git a/src/main/compile/michelson.ml b/src/main/compile/michelson.ml new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/compile/of_mini_c.ml b/src/main/compile/of_mini_c.ml new file mode 100644 index 000000000..ea964be97 --- /dev/null +++ b/src/main/compile/of_mini_c.ml @@ -0,0 +1,12 @@ +open Trace +open Mini_c +open Tezos_utils + +let compile_value : value -> type_value -> Michelson.t result = + Compiler.Program.translate_value + +let compile_expression : expression -> Michelson.t result = fun e -> + Compiler.Program.translate_expression e Compiler.Environment.empty + +let compile_function : anon_function -> type_value -> type_value -> Compiler.Program.compiled_program result = fun f in_ty out_ty -> + Compiler.Program.translate_entry f (in_ty , out_ty) diff --git a/src/main/compile/of_simplified.ml b/src/main/compile/of_simplified.ml new file mode 100644 index 000000000..b8b0ff78e --- /dev/null +++ b/src/main/compile/of_simplified.ml @@ -0,0 +1,6 @@ +open Ast_simplified +open Trace + +let compile_entry (program : program) entry_point = + let%bind typed_program = Typer.type_program program in + Of_typed.compile_entry typed_program entry_point diff --git a/src/main/compile/of_source.ml b/src/main/compile/of_source.ml new file mode 100644 index 000000000..f286ab848 --- /dev/null +++ b/src/main/compile/of_source.ml @@ -0,0 +1 @@ +open Trace diff --git a/src/main/compile/of_typed.ml b/src/main/compile/of_typed.ml new file mode 100644 index 000000000..b7a60fa3c --- /dev/null +++ b/src/main/compile/of_typed.ml @@ -0,0 +1,11 @@ +open Trace +open Ast_typed +open Tezos_utils + +let compile_expression : annotated_expression -> Michelson.t result = fun e -> + let%bind mini_c_expression = Transpiler.translate_annotated_expression e in + Of_mini_c.compile_expression mini_c_expression + +let compile_entry : program -> string -> _ = fun p entry -> + let%bind (f , (in_ty , out_ty)) = Transpiler.translate_entry p entry in + Of_mini_c.compile_function f in_ty out_ty diff --git a/src/run/display.ml b/src/main/run/display.ml similarity index 100% rename from src/run/display.ml rename to src/main/run/display.ml diff --git a/src/run/dune b/src/main/run/dune similarity index 88% rename from src/run/dune rename to src/main/run/dune index 747afb217..330bf32d5 100644 --- a/src/run/dune +++ b/src/main/run/dune @@ -1,6 +1,6 @@ (library - (name main) - (public_name ligo.main) + (name run) + (public_name ligo.run) (libraries simple-utils tezos-utils diff --git a/src/main/run/from_michelson.ml b/src/main/run/from_michelson.ml new file mode 100644 index 000000000..f34cb2333 --- /dev/null +++ b/src/main/run/from_michelson.ml @@ -0,0 +1,25 @@ +open Proto_alpha_utils +open Trace +open Compiler.Program +open Memory_proto_alpha.Protocol.Script_ir_translator +open Memory_proto_alpha.X + +type options = Memory_proto_alpha.options + +let run ?options (program:compiled_program) (input_michelson:Michelson.t) : ex_typed_value result = + let Compiler.Program.{input;output;body} : compiled_program = program in + let (Ex_ty input_ty) = input in + let (Ex_ty output_ty) = output in + let%bind input = + Trace.trace_tzresult_lwt (simple_error "error parsing input") @@ + Memory_proto_alpha.parse_michelson_data input_michelson input_ty in + let body = Michelson.strip_annots body in + let%bind descr = + Trace.trace_tzresult_lwt (simple_error "error parsing program code") @@ + Memory_proto_alpha.parse_michelson body + (Item_t (input_ty, Empty_t, None)) (Item_t (output_ty, Empty_t, None)) in + let open! Memory_proto_alpha.Protocol.Script_interpreter in + let%bind (Item(output, Empty)) = + Trace.trace_tzresult_lwt (simple_error "error of execution") @@ + Memory_proto_alpha.interpret ?options descr (Item(input, Empty)) in + ok (Ex_typed_value (output_ty, output)) diff --git a/src/run/main.ml b/src/main/run/main.ml similarity index 100% rename from src/run/main.ml rename to src/main/run/main.ml diff --git a/src/main/run/run_mini_c.ml b/src/main/run/run_mini_c.ml new file mode 100644 index 000000000..dd3dba8f1 --- /dev/null +++ b/src/main/run/run_mini_c.ml @@ -0,0 +1,38 @@ +open Proto_alpha_utils +open Memory_proto_alpha.X +open Trace +open Mini_c +open Compiler.Program + +type options = { + entry_point : anon_function ; + input_type : type_value ; + output_type : type_value ; + input : value ; + michelson_options : From_michelson.options ; +} + +let run_entry ?(debug_michelson = false) ?options (entry : anon_function) ty (input:value) : value result = + let%bind compiled = + trace error @@ + translate_entry entry ty in + let%bind input_michelson = translate_value input (fst ty) in + if debug_michelson then ( + Format.printf "Program: %a\n" Michelson.pp compiled.body ; + Format.printf "Expression: %a\n" PP.expression entry.result ; + Format.printf "Input: %a\n" PP.value input ; + Format.printf "Input Type: %a\n" PP.type_ (fst ty) ; + Format.printf "Compiled Input: %a\n" Michelson.pp input_michelson ; + ) ; + let%bind ex_ty_value = From_michelson.run ?options compiled input_michelson in + if debug_michelson then ( + let (Ex_typed_value (ty , v)) = ex_ty_value in + ignore @@ + let%bind michelson_value = + trace_tzresult_lwt (simple_error "debugging run_mini_c") @@ + Proto_alpha_utils.Memory_proto_alpha.unparse_michelson_data ty v in + Format.printf "Compiled Output: %a\n" Michelson.pp michelson_value ; + ok () + ) ; + let%bind (result : value) = Compiler.Uncompiler.translate_value ex_ty_value in + ok result diff --git a/src/run/run_simplified.ml b/src/main/run/run_simplified.ml similarity index 100% rename from src/run/run_simplified.ml rename to src/main/run/run_simplified.ml diff --git a/src/run/run_source.ml b/src/main/run/run_source.ml similarity index 74% rename from src/run/run_source.ml rename to src/main/run/run_source.ml index 10904914a..214d1e091 100644 --- a/src/run/run_source.ml +++ b/src/main/run/run_source.ml @@ -32,7 +32,7 @@ include struct trace_strong (simple_error "entry-point doesn't have a list of operation as first result") @@ assert_t_list_operation ops in let%bind () = - trace_strong (simple_error "entry-point doesn't identitcal type (storage) for second parameter and second result") @@ + trace_strong (simple_error "entry-point doesn't identical type (storage) for second parameter and second result") @@ assert_type_value_eq (storage_param , storage_result) in ok (arg' , storage_param) @@ -59,86 +59,7 @@ let transpile_value let%bind r = Run_mini_c.run_entry f ty input in ok (r , snd ty) -let parsify_pascaligo = fun source -> - let%bind raw = - trace (simple_error "parsing") @@ - Parser.Pascaligo.parse_file source in - let%bind simplified = - trace (simple_error "simplifying") @@ - Simplify.Pascaligo.simpl_program raw in - ok simplified - -let parsify_expression_pascaligo = fun source -> - let%bind raw = - trace (simple_error "parsing expression") @@ - Parser.Pascaligo.parse_expression source in - let%bind simplified = - trace (simple_error "simplifying expression") @@ - Simplify.Pascaligo.simpl_expression raw in - ok simplified - -let parsify_ligodity = fun source -> - let%bind raw = - trace (simple_error "parsing") @@ - Parser.Ligodity.parse_file source in - let%bind simplified = - trace (simple_error "simplifying") @@ - Simplify.Ligodity.simpl_program raw in - ok simplified - -let parsify_expression_ligodity = fun source -> - let%bind raw = - trace (simple_error "parsing expression") @@ - Parser.Ligodity.parse_expression source in - let%bind simplified = - trace (simple_error "simplifying expression") @@ - Simplify.Ligodity.simpl_expression raw in - ok simplified - -type s_syntax = Syntax_name of string -type v_syntax = [`pascaligo | `cameligo ] - -let syntax_to_variant : s_syntax -> string option -> v_syntax result = - fun syntax source_filename -> - let subr s n = - String.sub s (String.length s - n) n in - let endswith s suffix = - let suffixlen = String.length suffix in - ( String.length s >= suffixlen - && String.equal (subr s suffixlen) suffix) - in - match syntax with - Syntax_name syntax -> - begin - if String.equal syntax "auto" then - begin - match source_filename with - | Some source_filename - when endswith source_filename ".ligo" - -> ok `pascaligo - | Some source_filename - when endswith source_filename ".mligo" - -> ok `cameligo - | _ -> simple_fail "cannot auto-detect syntax, pleas use -s name_of_syntax" - end - else if String.equal syntax "pascaligo" then ok `pascaligo - else if String.equal syntax "cameligo" then ok `cameligo - else simple_fail "unrecognized parser" - end - -let parsify = fun (syntax : v_syntax) source_filename -> - let%bind parsify = match syntax with - | `pascaligo -> ok parsify_pascaligo - | `cameligo -> ok parsify_ligodity - in - parsify source_filename - -let parsify_expression = fun syntax source -> - let%bind parsify = match syntax with - | `pascaligo -> ok parsify_expression_pascaligo - | `cameligo -> ok parsify_expression_ligodity - in - parsify source +open Helpers let compile_contract_file : string -> string -> s_syntax -> string result = fun source_filename entry_point syntax -> let%bind syntax = syntax_to_variant syntax (Some source_filename) in diff --git a/src/run/run_typed.ml b/src/main/run/run_typed.ml similarity index 100% rename from src/run/run_typed.ml rename to src/main/run/run_typed.ml diff --git a/src/passes/8-compiler/compiler_environment.ml b/src/passes/8-compiler/compiler_environment.ml index c5fcd040b..a196d9c49 100644 --- a/src/passes/8-compiler/compiler_environment.ml +++ b/src/passes/8-compiler/compiler_environment.ml @@ -3,6 +3,8 @@ open Mini_c open Environment open Michelson +let empty : environment = [] + let get : environment -> string -> michelson result = fun e s -> let%bind (_ , position) = let error = diff --git a/src/run/run_mini_c.ml b/src/run/run_mini_c.ml deleted file mode 100644 index d13b4cc54..000000000 --- a/src/run/run_mini_c.ml +++ /dev/null @@ -1,55 +0,0 @@ -open Proto_alpha_utils -open Trace -open Mini_c -open! Compiler.Program -open Memory_proto_alpha.Protocol.Script_ir_translator -open Memory_proto_alpha.X - -let run_aux ?options (program:compiled_program) (input_michelson:Michelson.t) : ex_typed_value result = - let Compiler.Program.{input;output;body} : compiled_program = program in - let (Ex_ty input_ty) = input in - let (Ex_ty output_ty) = output in - let%bind input = - Trace.trace_tzresult_lwt (simple_error "error parsing input") @@ - Memory_proto_alpha.parse_michelson_data input_michelson input_ty in - let body = Michelson.strip_annots body in - let%bind descr = - Trace.trace_tzresult_lwt (simple_error "error parsing program code") @@ - Memory_proto_alpha.parse_michelson body - (Item_t (input_ty, Empty_t, None)) (Item_t (output_ty, Empty_t, None)) in - let open! Memory_proto_alpha.Protocol.Script_interpreter in - let%bind (Item(output, Empty)) = - Trace.trace_tzresult_lwt (simple_error "error of execution") @@ - Memory_proto_alpha.interpret ?options descr (Item(input, Empty)) in - ok (Ex_typed_value (output_ty, output)) - -let run_entry ?(debug_michelson = false) ?options (entry:anon_function) ty (input:value) : value result = - let%bind compiled = - let error = - let title () = "compile entry" in - let content () = - Format.asprintf "%a" PP.function_ entry - in - error title content in - trace error @@ - translate_entry entry ty in - let%bind input_michelson = translate_value input (fst ty) in - if debug_michelson then ( - Format.printf "Program: %a\n" Michelson.pp compiled.body ; - Format.printf "Expression: %a\n" PP.expression entry.result ; - Format.printf "Input: %a\n" PP.value input ; - Format.printf "Input Type: %a\n" PP.type_ (fst ty) ; - Format.printf "Compiled Input: %a\n" Michelson.pp input_michelson ; - ) ; - let%bind ex_ty_value = run_aux ?options compiled input_michelson in - if debug_michelson then ( - let (Ex_typed_value (ty , v)) = ex_ty_value in - ignore @@ - let%bind michelson_value = - trace_tzresult_lwt (simple_error "debugging run_mini_c") @@ - Proto_alpha_utils.Memory_proto_alpha.unparse_michelson_data ty v in - Format.printf "Compiled Output: %a\n" Michelson.pp michelson_value ; - ok () - ) ; - let%bind (result : value) = Compiler.Uncompiler.translate_value ex_ty_value in - ok result diff --git a/test/.merlin b/test/.merlin deleted file mode 100644 index ae626d691..000000000 --- a/test/.merlin +++ /dev/null @@ -1,187 +0,0 @@ -EXCLUDE_QUERY_DIR -B /home/cc/Programming/ligo/_opam/lib/alcotest -B /home/cc/Programming/ligo/_opam/lib/astring -B /home/cc/Programming/ligo/_opam/lib/base/caml -B /home/cc/Programming/ligo/_opam/lib/bigarray-compat -B /home/cc/Programming/ligo/_opam/lib/bigstring -B /home/cc/Programming/ligo/_opam/lib/biniou -B /home/cc/Programming/ligo/_opam/lib/blake2 -B /home/cc/Programming/ligo/_opam/lib/bytes -B /home/cc/Programming/ligo/_opam/lib/cmdliner -B /home/cc/Programming/ligo/_opam/lib/cstruct -B /home/cc/Programming/ligo/_opam/lib/easy-format -B /home/cc/Programming/ligo/_opam/lib/ezjsonm -B /home/cc/Programming/ligo/_opam/lib/fmt -B /home/cc/Programming/ligo/_opam/lib/getopt -B /home/cc/Programming/ligo/_opam/lib/hacl -B /home/cc/Programming/ligo/_opam/lib/hex -B /home/cc/Programming/ligo/_opam/lib/ipaddr -B /home/cc/Programming/ligo/_opam/lib/ipaddr/unix -B /home/cc/Programming/ligo/_opam/lib/jsonm -B /home/cc/Programming/ligo/_opam/lib/lwt -B /home/cc/Programming/ligo/_opam/lib/lwt/unix -B /home/cc/Programming/ligo/_opam/lib/lwt_log -B /home/cc/Programming/ligo/_opam/lib/lwt_log/core -B /home/cc/Programming/ligo/_opam/lib/macaddr -B /home/cc/Programming/ligo/_opam/lib/mmap -B /home/cc/Programming/ligo/_opam/lib/mtime -B /home/cc/Programming/ligo/_opam/lib/mtime/os -B /home/cc/Programming/ligo/_opam/lib/ocaml -B /home/cc/Programming/ligo/_opam/lib/ocaml/threads -B /home/cc/Programming/ligo/_opam/lib/ocplib-endian -B /home/cc/Programming/ligo/_opam/lib/ocplib-json-typed -B /home/cc/Programming/ligo/_opam/lib/ocplib-json-typed-bson -B /home/cc/Programming/ligo/_opam/lib/ocplib-resto -B /home/cc/Programming/ligo/_opam/lib/ocplib-resto-directory -B /home/cc/Programming/ligo/_opam/lib/parsexp -B /home/cc/Programming/ligo/_opam/lib/ppx_deriving/runtime -B /home/cc/Programming/ligo/_opam/lib/ptime -B /home/cc/Programming/ligo/_opam/lib/ptime/os -B /home/cc/Programming/ligo/_opam/lib/re -B /home/cc/Programming/ligo/_opam/lib/re/posix -B /home/cc/Programming/ligo/_opam/lib/re/str -B /home/cc/Programming/ligo/_opam/lib/result -B /home/cc/Programming/ligo/_opam/lib/secp256k1 -B /home/cc/Programming/ligo/_opam/lib/seq -B /home/cc/Programming/ligo/_opam/lib/sexplib -B /home/cc/Programming/ligo/_opam/lib/sexplib0 -B /home/cc/Programming/ligo/_opam/lib/stdlib-shims -B /home/cc/Programming/ligo/_opam/lib/stringext -B /home/cc/Programming/ligo/_opam/lib/tezos-base -B /home/cc/Programming/ligo/_opam/lib/tezos-clic -B /home/cc/Programming/ligo/_opam/lib/tezos-crypto -B /home/cc/Programming/ligo/_opam/lib/tezos-data-encoding -B /home/cc/Programming/ligo/_opam/lib/tezos-error-monad -B /home/cc/Programming/ligo/_opam/lib/tezos-event-logging -B /home/cc/Programming/ligo/_opam/lib/tezos-micheline -B /home/cc/Programming/ligo/_opam/lib/tezos-protocol-environment -B /home/cc/Programming/ligo/_opam/lib/tezos-protocol-environment-sigs -B /home/cc/Programming/ligo/_opam/lib/tezos-rpc -B /home/cc/Programming/ligo/_opam/lib/tezos-stdlib -B /home/cc/Programming/ligo/_opam/lib/tezos-stdlib-unix -B /home/cc/Programming/ligo/_opam/lib/uchar -B /home/cc/Programming/ligo/_opam/lib/uecc -B /home/cc/Programming/ligo/_opam/lib/uri -B /home/cc/Programming/ligo/_opam/lib/uuidm -B /home/cc/Programming/ligo/_opam/lib/uutf -B /home/cc/Programming/ligo/_opam/lib/yojson -B /home/cc/Programming/ligo/_opam/lib/zarith -B ../_build/default/src/.ligo.objs/byte -B ../_build/default/src/passes/1-parser/.parser.objs/byte -B ../_build/default/src/passes/1-parser/camligo/.parser_camligo.objs/byte -B ../_build/default/src/passes/1-parser/camligo/lex/.lex.objs/byte -B ../_build/default/src/passes/1-parser/ligodity/.parser_ligodity.objs/byte -B ../_build/default/src/passes/1-parser/pascaligo/.parser_pascaligo.objs/byte -B ../_build/default/src/passes/1-parser/shared/.parser_shared.objs/byte -B ../_build/default/src/passes/2-simplify/.simplify.objs/byte -B ../_build/default/src/passes/4-typer/.typer.objs/byte -B ../_build/default/src/passes/6-transpiler/.transpiler.objs/byte -B ../_build/default/src/passes/8-compiler/.compiler.objs/byte -B ../_build/default/src/passes/operators/.operators.objs/byte -B ../_build/default/src/run/main/.main.objs/byte -B ../_build/default/src/stages/ast_simplified/.ast_simplified.objs/byte -B ../_build/default/src/stages/ast_typed/.ast_typed.objs/byte -B ../_build/default/src/stages/mini_c/.mini_c.objs/byte -B ../_build/default/test/.test.eobjs/byte -B ../_build/default/vendors/ligo-utils/memory-proto-alpha/.memory_proto_alpha.objs/byte -B ../_build/default/vendors/ligo-utils/proto-alpha-utils/.proto_alpha_utils.objs/byte -B ../_build/default/vendors/ligo-utils/simple-utils/.simple_utils.objs/byte -B ../_build/default/vendors/ligo-utils/tezos-protocol-alpha-parameters/.tezos_protocol_alpha_parameters.objs/byte -B ../_build/default/vendors/ligo-utils/tezos-protocol-alpha/.tezos_protocol_alpha.objs/byte -B ../_build/default/vendors/ligo-utils/tezos-protocol-alpha/.tezos_protocol_environment_alpha.objs/byte -B ../_build/default/vendors/ligo-utils/tezos-protocol-alpha/.tezos_raw_protocol_alpha.objs/byte -B ../_build/default/vendors/ligo-utils/tezos-utils/.tezos_utils.objs/byte -B ../_build/default/vendors/ligo-utils/tezos-utils/michelson-parser/.michelson_parser.objs/byte -S /home/cc/Programming/ligo/_opam/lib/alcotest -S /home/cc/Programming/ligo/_opam/lib/astring -S /home/cc/Programming/ligo/_opam/lib/base/caml -S /home/cc/Programming/ligo/_opam/lib/bigarray-compat -S /home/cc/Programming/ligo/_opam/lib/bigstring -S /home/cc/Programming/ligo/_opam/lib/biniou -S /home/cc/Programming/ligo/_opam/lib/blake2 -S /home/cc/Programming/ligo/_opam/lib/bytes -S /home/cc/Programming/ligo/_opam/lib/cmdliner -S /home/cc/Programming/ligo/_opam/lib/cstruct -S /home/cc/Programming/ligo/_opam/lib/easy-format -S /home/cc/Programming/ligo/_opam/lib/ezjsonm -S /home/cc/Programming/ligo/_opam/lib/fmt -S /home/cc/Programming/ligo/_opam/lib/getopt -S /home/cc/Programming/ligo/_opam/lib/hacl -S /home/cc/Programming/ligo/_opam/lib/hex -S /home/cc/Programming/ligo/_opam/lib/ipaddr -S /home/cc/Programming/ligo/_opam/lib/ipaddr/unix -S /home/cc/Programming/ligo/_opam/lib/jsonm -S /home/cc/Programming/ligo/_opam/lib/lwt -S /home/cc/Programming/ligo/_opam/lib/lwt/unix -S /home/cc/Programming/ligo/_opam/lib/lwt_log -S /home/cc/Programming/ligo/_opam/lib/lwt_log/core -S /home/cc/Programming/ligo/_opam/lib/macaddr -S /home/cc/Programming/ligo/_opam/lib/mmap -S /home/cc/Programming/ligo/_opam/lib/mtime -S /home/cc/Programming/ligo/_opam/lib/mtime/os -S /home/cc/Programming/ligo/_opam/lib/ocaml -S /home/cc/Programming/ligo/_opam/lib/ocaml/threads -S /home/cc/Programming/ligo/_opam/lib/ocplib-endian -S /home/cc/Programming/ligo/_opam/lib/ocplib-json-typed -S /home/cc/Programming/ligo/_opam/lib/ocplib-json-typed-bson -S /home/cc/Programming/ligo/_opam/lib/ocplib-resto -S /home/cc/Programming/ligo/_opam/lib/ocplib-resto-directory -S /home/cc/Programming/ligo/_opam/lib/parsexp -S /home/cc/Programming/ligo/_opam/lib/ppx_deriving/runtime -S /home/cc/Programming/ligo/_opam/lib/ptime -S /home/cc/Programming/ligo/_opam/lib/ptime/os -S /home/cc/Programming/ligo/_opam/lib/re -S /home/cc/Programming/ligo/_opam/lib/re/posix -S /home/cc/Programming/ligo/_opam/lib/re/str -S /home/cc/Programming/ligo/_opam/lib/result -S /home/cc/Programming/ligo/_opam/lib/secp256k1 -S /home/cc/Programming/ligo/_opam/lib/seq -S /home/cc/Programming/ligo/_opam/lib/sexplib -S /home/cc/Programming/ligo/_opam/lib/sexplib0 -S /home/cc/Programming/ligo/_opam/lib/stdlib-shims -S /home/cc/Programming/ligo/_opam/lib/stringext -S /home/cc/Programming/ligo/_opam/lib/tezos-base -S /home/cc/Programming/ligo/_opam/lib/tezos-clic -S /home/cc/Programming/ligo/_opam/lib/tezos-crypto -S /home/cc/Programming/ligo/_opam/lib/tezos-data-encoding -S /home/cc/Programming/ligo/_opam/lib/tezos-error-monad -S /home/cc/Programming/ligo/_opam/lib/tezos-event-logging -S /home/cc/Programming/ligo/_opam/lib/tezos-micheline -S /home/cc/Programming/ligo/_opam/lib/tezos-protocol-environment -S /home/cc/Programming/ligo/_opam/lib/tezos-protocol-environment-sigs -S /home/cc/Programming/ligo/_opam/lib/tezos-rpc -S /home/cc/Programming/ligo/_opam/lib/tezos-stdlib -S /home/cc/Programming/ligo/_opam/lib/tezos-stdlib-unix -S /home/cc/Programming/ligo/_opam/lib/uchar -S /home/cc/Programming/ligo/_opam/lib/uecc -S /home/cc/Programming/ligo/_opam/lib/uri -S /home/cc/Programming/ligo/_opam/lib/uuidm -S /home/cc/Programming/ligo/_opam/lib/uutf -S /home/cc/Programming/ligo/_opam/lib/yojson -S /home/cc/Programming/ligo/_opam/lib/zarith -S ../src -S ../src/passes/1-parser -S ../src/passes/1-parser/camligo -S ../src/passes/1-parser/camligo/lex -S ../src/passes/1-parser/ligodity -S ../src/passes/1-parser/pascaligo -S ../src/passes/1-parser/shared -S ../src/passes/2-simplify -S ../src/passes/4-typer -S ../src/passes/6-transpiler -S ../src/passes/8-compiler -S ../src/passes/operators -S ../src/run/main -S ../src/stages/ast_simplified -S ../src/stages/ast_typed -S ../src/stages/mini_c -S . -S ../vendors/ligo-utils/memory-proto-alpha -S ../vendors/ligo-utils/proto-alpha-utils -S ../vendors/ligo-utils/simple-utils -S ../vendors/ligo-utils/tezos-protocol-alpha -S ../vendors/ligo-utils/tezos-protocol-alpha-parameters -S ../vendors/ligo-utils/tezos-utils -S ../vendors/ligo-utils/tezos-utils/michelson-parser -FLG -ppx '/home/cc/Programming/ligo/_build/default/.ppx/0af9cc0ed9166d3107af7264d5703b53/ppx.exe --as-ppx' -FLG -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -w +1..62-4-9-44-40-42-48@39@33 -open Simple_utils diff --git a/test/coase_tests.ml b/test/coase_tests.ml index bbfd75b51..135f9b429 100644 --- a/test/coase_tests.ml +++ b/test/coase_tests.ml @@ -4,7 +4,7 @@ open Trace open Ligo.Run open Test_helpers -let type_file = type_file `pascaligo +let type_file = type_file Pascaligo let get_program = let s = ref None in diff --git a/test/heap_tests.ml b/test/heap_tests.ml index 5a6f440df..fb3821f27 100644 --- a/test/heap_tests.ml +++ b/test/heap_tests.ml @@ -2,7 +2,7 @@ open Trace open Ligo.Run open Test_helpers -let type_file = type_file `pascaligo +let type_file = type_file Pascaligo let get_program = let s = ref None in diff --git a/test/integration_tests.ml b/test/integration_tests.ml index 4432f07b9..781cb3a53 100644 --- a/test/integration_tests.ml +++ b/test/integration_tests.ml @@ -4,8 +4,8 @@ open Test_helpers open Ast_simplified.Combinators -let mtype_file ?debug_simplify ?debug_typed = type_file ?debug_simplify ?debug_typed `cameligo -let type_file = type_file `pascaligo +let mtype_file ?debug_simplify ?debug_typed = type_file ?debug_simplify ?debug_typed Cameligo +let type_file = type_file Pascaligo let type_alias () : unit result = let%bind program = type_file "./contracts/type-alias.ligo" in diff --git a/test/vote_tests.ml b/test/vote_tests.ml index d4d1f9336..fbcf2b7ee 100644 --- a/test/vote_tests.ml +++ b/test/vote_tests.ml @@ -7,7 +7,7 @@ let get_program = fun () -> match !s with | Some s -> ok s | None -> ( - let%bind program = type_file `cameligo "./contracts/vote.mligo" in + let%bind program = type_file Cameligo "./contracts/vote.mligo" in s := Some program ; ok program )