Format code

This commit is contained in:
Raphaël Monat 2023-03-10 09:49:16 +01:00
parent d3c27799de
commit 51ea9d8cff
2 changed files with 13 additions and 7 deletions

View File

@ -917,12 +917,14 @@ let translate_scope_decl
ctx scope_variables
in
let date_rounding : date_rounding =
match List.find_opt
(function Desugared.Ast.DateRounding _ -> true)
sigma.scope_options with
| Some (Desugared.Ast.DateRounding Desugared.Ast.Increasing) -> RoundUp
| Some (DateRounding Decreasing) -> RoundDown
| None -> AbortOnRound
match
List.find_opt
(function Desugared.Ast.DateRounding _ -> true)
sigma.scope_options
with
| Some (Desugared.Ast.DateRounding Desugared.Ast.Increasing) -> RoundUp
| Some (DateRounding Decreasing) -> RoundDown
| None -> AbortOnRound
in
let ctx = { ctx with date_rounding } in
let scope_input_var = scope_sig.scope_sig_input_var in

View File

@ -1151,7 +1151,11 @@ let process_scope_use_item
| Surface.Ast.Decreasing -> Ast.Decreasing
in
let new_scope =
match List.find_opt (fun scope_opt -> scope_opt = Ast.DateRounding _) scope.scope_options with
match
List.find_opt
(fun scope_opt -> scope_opt = Ast.DateRounding _)
scope.scope_options
with
| Some _ ->
Errors.raise_spanned_error (Marked.get_mark item)
"A date rounding mode has already been specified"