mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Few progress
This commit is contained in:
parent
c456a62cb3
commit
50400c445d
@ -273,5 +273,6 @@ let rec format_expr (ctx : Ast.decl_ctx) (fmt : Format.formatter) (e : expr Pos.
|
||||
Format.fprintf fmt "@[<hov 2>%a@ %a%a%a@]" format_keyword "assert" format_punctuation "("
|
||||
format_expr e' format_punctuation ")"
|
||||
|
||||
let format_scope (_ctx : decl_ctx) (_fmt : Format.formatter) (_s : scope_body) =
|
||||
failwith "unimplemented"
|
||||
let format_scope (ctx : decl_ctx) (fmt : Format.formatter) ((n, s) : Ast.ScopeName.t * scope_body) =
|
||||
Format.fprintf fmt "@[<hov 2>let %a = %a@]" Ast.ScopeName.format_t n (format_expr ctx)
|
||||
(Ast.build_whole_scope_expr s)
|
||||
|
@ -44,4 +44,4 @@ val format_var : Format.formatter -> Ast.Var.t -> unit
|
||||
|
||||
val format_expr : Ast.decl_ctx -> Format.formatter -> Ast.expr Pos.marked -> unit
|
||||
|
||||
val format_scope : Ast.decl_ctx -> Format.formatter -> Ast.scope_body -> unit
|
||||
val format_scope : Ast.decl_ctx -> Format.formatter -> Ast.ScopeName.t * Ast.scope_body -> unit
|
||||
|
@ -204,7 +204,7 @@ let driver (source_file : Pos.input_file) (debug : bool) (unstyled : bool)
|
||||
Format.fprintf fmt "%a\n"
|
||||
(Dcalc.Print.format_scope prgm.decl_ctx)
|
||||
(let _, _, s = List.find (fun (name, _, _) -> name = scope_uid) prgm.scopes in
|
||||
s)
|
||||
(scope_uid, s))
|
||||
else Format.fprintf fmt "%a\n" (Dcalc.Print.format_expr prgm.decl_ctx) prgrm_dcalc_expr;
|
||||
at_end ();
|
||||
exit 0
|
||||
|
@ -17,6 +17,8 @@ module D = Dcalc.Ast
|
||||
module A = Ast
|
||||
|
||||
type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t
|
||||
(** This environment contains a mapping between the variables in Dcalc and their correspondance in
|
||||
Lcalc. *)
|
||||
|
||||
let translate_lit (l : D.lit) : A.expr =
|
||||
match l with
|
||||
|
Loading…
Reference in New Issue
Block a user