Builds (commented out a few issues, just to check that there are no compilation errors left)
This commit is contained in:
parent
acfbd7eb15
commit
581babb459
@ -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 =
|
||||
|
@ -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 =
|
||||
|
@ -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 *)
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user