mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Printer: add some missing boxes
This commit is contained in:
parent
404dc00db1
commit
8a2b50289e
@ -431,12 +431,13 @@ let rec expr_aux :
|
||||
Format.fprintf fmt "@[<hov 2>%a@ %a@ %a@]" operator op (lhs exprc) arg1
|
||||
(rhs exprc) arg2
|
||||
| EApp { f = EOp { op = (And | Or) as op; _ }, _; args = [arg1; arg2] } ->
|
||||
Format.fprintf fmt "%a@ %a %a" (lhs exprc) arg1 operator op (rhs exprc) arg2
|
||||
Format.fprintf fmt "@[<hv 0>%a@ %a %a@]" (lhs exprc) arg1 operator op
|
||||
(rhs exprc) arg2
|
||||
| EApp { f = EOp { op; _ }, _; args = [arg1; arg2] } ->
|
||||
Format.fprintf fmt "@[<hv 0>%a@ %a %a@]" (lhs exprc) arg1 operator op
|
||||
(rhs exprc) arg2
|
||||
| EApp { f = EOp { op; _ }, _; args = [arg1] } ->
|
||||
Format.fprintf fmt "%a %a" operator op (rhs exprc) arg1
|
||||
Format.fprintf fmt "@[<hv 2>%a@ %a@]" operator op (rhs exprc) arg1
|
||||
| EApp { f; args } ->
|
||||
Format.fprintf fmt "@[<hv 2>%a@ %a@]" (lhs exprc) f
|
||||
(Format.pp_print_list
|
||||
@ -473,8 +474,8 @@ let rec expr_aux :
|
||||
Format.fprintf fmt "@[<hov 2>%a@ %a@]" keyword "raise" except exn
|
||||
| ELocation loc -> location fmt loc
|
||||
| EDStructAccess { e; field; _ } ->
|
||||
Format.fprintf fmt "%a%a%a%a%a" (lhs exprc) e punctuation "." punctuation
|
||||
"\"" IdentName.format_t field punctuation "\""
|
||||
Format.fprintf fmt "@[<hv 2>%a%a@,%a%a%a@]" (lhs exprc) e punctuation "."
|
||||
punctuation "\"" IdentName.format_t field punctuation "\""
|
||||
| EStruct { name; fields } ->
|
||||
Format.fprintf fmt "@[<hv 0>@[<hv 2>%a@,@[<hv 0>%a@]@]@,%a%a@]" punctuation
|
||||
"{"
|
||||
@ -487,10 +488,11 @@ let rec expr_aux :
|
||||
(StructField.Map.bindings fields)
|
||||
punctuation "}_" StructName.format_t name
|
||||
| EStructAccess { e; field; _ } ->
|
||||
Format.fprintf fmt "%a%a%a%a%a" (lhs exprc) e punctuation "." punctuation
|
||||
"\"" StructField.format_t field punctuation "\""
|
||||
Format.fprintf fmt "@[<hv 2>%a%a@,%a%a%a@]" (lhs exprc) e punctuation "."
|
||||
punctuation "\"" StructField.format_t field punctuation "\""
|
||||
| EInj { e; cons; _ } ->
|
||||
Format.fprintf fmt "%a@ %a" EnumConstructor.format_t cons (rhs exprc) e
|
||||
Format.fprintf fmt "@[<hv 2>%a@ %a@]" EnumConstructor.format_t cons
|
||||
(rhs exprc) e
|
||||
| EMatch { e; cases; _ } ->
|
||||
Format.fprintf fmt "@[<v 0>@[<hov 2>%a@ %a@]@ %a@ %a@]" keyword "match"
|
||||
(lhs exprc) e keyword "with"
|
||||
|
Loading…
Reference in New Issue
Block a user