mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
refactor(compiler): revert #5042a006 for the Lcalc.Ast.NoValueProvided exn
This commit is contained in:
parent
df578e78bc
commit
e469854e86
@ -24,7 +24,7 @@ type lit =
|
||||
| LDate of Runtime.date
|
||||
| LDuration of Runtime.duration
|
||||
|
||||
type except = ConflictError | EmptyError | NoValueProvided of Dcalc.Ast.expr Pos.marked | Crash
|
||||
type except = ConflictError | EmptyError | NoValueProvided | Crash
|
||||
|
||||
type expr =
|
||||
| EVar of expr Bindlib.var Pos.marked
|
||||
|
@ -30,7 +30,7 @@ type lit =
|
||||
| LDate of Runtime.date
|
||||
| LDuration of Runtime.duration
|
||||
|
||||
type except = ConflictError | EmptyError | NoValueProvided of Dcalc.Ast.expr Pos.marked | Crash
|
||||
type except = ConflictError | EmptyError | NoValueProvided | Crash
|
||||
|
||||
type expr =
|
||||
| EVar of expr Bindlib.var Pos.marked
|
||||
|
@ -90,7 +90,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl
|
||||
Bindlib.box_apply
|
||||
(fun arg ->
|
||||
Pos.same_pos_as
|
||||
(A.ECatch (arg, A.EmptyError, Pos.same_pos_as (A.ERaise (A.NoValueProvided e)) e))
|
||||
(A.ECatch (arg, A.EmptyError, Pos.same_pos_as (A.ERaise A.NoValueProvided) e))
|
||||
e)
|
||||
(translate_expr ctx arg)
|
||||
| D.EApp (e1, args) ->
|
||||
|
@ -62,8 +62,7 @@ let format_exception (fmt : Format.formatter) (exn : except) : unit =
|
||||
| EmptyError -> Format.fprintf fmt "EmptyError"
|
||||
| ConflictError -> Format.fprintf fmt "ConflictError"
|
||||
| Crash -> Format.fprintf fmt "Crash"
|
||||
(* TODO: manage position. *)
|
||||
| NoValueProvided _ -> Format.fprintf fmt "NoValueProvided"
|
||||
| NoValueProvided -> Format.fprintf fmt "NoValueProvided"
|
||||
|
||||
let format_keyword (fmt : Format.formatter) (s : string) : unit =
|
||||
Format.fprintf fmt "%s" (Utils.Cli.print_with_style [ ANSITerminal.red ] "%s" s)
|
||||
|
@ -234,7 +234,8 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp
|
||||
| ConflictError -> Format.fprintf fmt "ConflictError"
|
||||
| EmptyError -> Format.fprintf fmt "EmptyError"
|
||||
| Crash -> Format.fprintf fmt "Crash"
|
||||
| NoValueProvided (_, pos) ->
|
||||
| NoValueProvided ->
|
||||
let _, pos = e in
|
||||
Format.fprintf fmt
|
||||
"(NoValueProvided@ @[<hov 2>{filename = \"%s\";@ start_line=%d;@ start_column=%d;@ \
|
||||
end_line=%d; end_column=%d;@ law_headings=%a}@])"
|
||||
|
Loading…
Reference in New Issue
Block a user