From 581babb45906fecf6c53952c89daab5e5b42376c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzanne=20Dup=C3=A9ron?= Date: Thu, 10 Oct 2019 03:55:08 -0400 Subject: [PATCH] Builds (commented out a few issues, just to check that there are no compilation errors left) --- src/bin/cli.ml | 23 ++++++++++++----------- src/main/compile/of_simplified.ml | 12 +++++++----- src/main/compile/of_source.ml | 26 ++++++++++++++------------ src/passes/4-typer/typer.ml | 3 ++- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/bin/cli.ml b/src/bin/cli.ml index 31e9261ab..9a59280de 100644 --- a/src/bin/cli.ml +++ b/src/bin/cli.ml @@ -139,17 +139,18 @@ let run_function = (term , Term.info ~docs cmdname) let evaluate_value = - let f source entry_point amount syntax display_format = - toplevel ~display_format @@ - let%bind output = - Ligo.Run.Of_source.evaluate_entry ~amount source entry_point (Syntax_name syntax) in - ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression output - in - let term = - Term.(const f $ source 0 $ entry_point 1 $ amount $ syntax $ display_format) in - let cmdname = "evaluate-value" in - let docs = "Subcommand: evaluate a given definition." in - (term , Term.info ~docs cmdname) + failwith "TODO" + (* let f source entry_point amount syntax display_format = + * toplevel ~display_format @@ + * let%bind output = + * Ligo.Run.Of_source.evaluate_entry ~amount source entry_point (Syntax_name syntax) in + * ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression output + * in + * let term = + * Term.(const f $ source 0 $ entry_point 1 $ amount $ syntax $ display_format) in + * let cmdname = "evaluate-value" in + * let docs = "Subcommand: evaluate a given definition." in + * (term , Term.info ~docs cmdname) *) let compile_expression = let f expression syntax display_format = diff --git a/src/main/compile/of_simplified.ml b/src/main/compile/of_simplified.ml index cf8bc00fd..3e4a5e9d1 100644 --- a/src/main/compile/of_simplified.ml +++ b/src/main/compile/of_simplified.ml @@ -3,23 +3,25 @@ open Trace open Tezos_utils let compile_contract_entry (program : program) entry_point = - let%bind prog_typed = Typer.type_program program in + let%bind (_ , _ , prog_typed) = Typer.type_program program in Of_typed.compile_contract_entry prog_typed entry_point let compile_function_entry (program : program) entry_point : _ result = - let%bind prog_typed = Typer.type_program program in + let%bind (_ , _ , prog_typed) = Typer.type_program program in Of_typed.compile_function_entry prog_typed entry_point let compile_expression_as_function_entry (program : program) entry_point : _ result = - let%bind typed_program = Typer.type_program program in + let%bind (_,_,typed_program) = Typer.type_program program in Of_typed.compile_expression_as_function_entry typed_program entry_point let compile_expression_as_value ?(env = Ast_typed.Environment.full_empty) ae : Michelson.t result = - let%bind typed = Typer.type_expression env ae in + let todo_state = failwith "todo" in + let%bind (typed , _) = Typer.type_expression env todo_state ae in Of_typed.compile_expression_as_value typed let compile_expression_as_function ?(env = Ast_typed.Environment.full_empty) ae : _ result = - let%bind typed = Typer.type_expression env ae in + let todo_state = failwith "todo" in + let%bind (typed , _) = Typer.type_expression env todo_state ae in Of_typed.compile_expression_as_function typed let uncompile_typed_program_entry_expression_result program entry ex_ty_value = diff --git a/src/main/compile/of_source.ml b/src/main/compile/of_source.ml index f7576ec19..bf1e4e6bc 100644 --- a/src/main/compile/of_source.ml +++ b/src/main/compile/of_source.ml @@ -25,15 +25,17 @@ let compile_expression_as_function : string -> s_syntax -> _ result = let type_file ?(debug_simplify = false) ?(debug_typed = false) syntax (source_filename:string) : Ast_typed.program result = - let%bind syntax = syntax_to_variant syntax (Some source_filename) in - let%bind simpl = parsify syntax source_filename in - (if debug_simplify then - Format.(printf "Simplified : %a\n%!" Ast_simplified.PP.program simpl) - ) ; - let%bind typed = - trace (simple_error "typing") @@ - Typer.type_program simpl in - (if debug_typed then ( - Format.(printf "Typed : %a\n%!" Ast_typed.PP.program typed) - )) ; - ok typed + let _ = debug_simplify, debug_typed, syntax, source_filename in + failwith "TODO" + (* let%bind syntax = syntax_to_variant syntax (Some source_filename) in + * let%bind simpl = parsify syntax source_filename in + * (if debug_simplify then + * Format.(printf "Simplified : %a\n%!" Ast_simplified.PP.program simpl) + * ) ; + * let%bind typed = + * trace (simple_error "typing") @@ + * Typer.type_program simpl in + * (if debug_typed then ( + * Format.(printf "Typed : %a\n%!" Ast_typed.PP.program typed) + * )) ; + * ok typed *) diff --git a/src/passes/4-typer/typer.ml b/src/passes/4-typer/typer.ml index f6a9078ff..330615bf9 100644 --- a/src/passes/4-typer/typer.ml +++ b/src/passes/4-typer/typer.ml @@ -873,8 +873,9 @@ and type_expression : environment -> Solver.state -> I.expression -> (O.annotate let%bind (result , state') = type_expression e' state result in let output_type = result.type_annotation in let wrapped = Wrap.lambda fresh input_type' output_type' in + let _TODO = output_type in return_wrapped - (E_lambda {binder = fst binder; input_type=fresh;output_type; body=result}) + (E_lambda {binder = fst binder;(* input_type=fresh;output_type; *)body=result}) state' wrapped )