mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
trace flag when needed
This commit is contained in:
parent
2a50a06b36
commit
cc1c018818
@ -132,11 +132,13 @@ let merge_defaults
|
||||
|
||||
let tag_with_log_entry
|
||||
(e : 'm Ast.expr boxed)
|
||||
(_l : log_entry)
|
||||
(_markings : Uid.MarkedString.info list) : 'm Ast.expr boxed =
|
||||
let _m = mark_tany (Marked.get_mark e) (Expr.pos e) in
|
||||
(* Expr.eapp (Expr.eop (Log (l, markings)) [TAny, Expr.pos e] m) [e] m *)
|
||||
e
|
||||
(l : log_entry)
|
||||
(markings : Uid.MarkedString.info list) : 'm Ast.expr boxed =
|
||||
let m = mark_tany (Marked.get_mark e) (Expr.pos e) in
|
||||
|
||||
if !Cli.trace_flag then
|
||||
Expr.eapp (Expr.eop (Log (l, markings)) [TAny, Expr.pos e] m) [e] m
|
||||
else e
|
||||
|
||||
(* In a list of exceptions, it is normally an error if more than a single one
|
||||
apply at the same time. This relaxes this constraint slightly, allowing a
|
||||
|
@ -36,9 +36,11 @@ let tag_with_log_entry
|
||||
(e : untyped Ast.expr boxed)
|
||||
(l : log_entry)
|
||||
(markings : Uid.MarkedString.info list) : untyped Ast.expr boxed =
|
||||
Expr.eapp
|
||||
(Expr.eop (Log (l, markings)) [TAny, Expr.pos e] (Marked.get_mark e))
|
||||
[e] (Marked.get_mark e)
|
||||
if !Cli.trace_flag then
|
||||
Expr.eapp
|
||||
(Expr.eop (Log (l, markings)) [TAny, Expr.pos e] (Marked.get_mark e))
|
||||
[e] (Marked.get_mark e)
|
||||
else e
|
||||
|
||||
let rec translate_expr (ctx : ctx) (e : Desugared.Ast.expr) :
|
||||
untyped Ast.expr boxed =
|
||||
|
Loading…
Reference in New Issue
Block a user