From 651c33bbe9ef20f2466ae8add3d8f316ec25985a Mon Sep 17 00:00:00 2001 From: Guillaume Claret Date: Wed, 22 Jun 2022 22:08:21 +0200 Subject: [PATCH] Upgrade ocamlformat --- .github/workflows/ci.yml | 2 +- .ocamlformat | 2 +- src/adtConstructors.ml | 5 ++--- src/constant.ml | 6 +++--- src/structure.ml | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e177212..ebcab89d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: with: ocaml-version: ${{ matrix.ocaml-version }} - - run: opam install ocamlformat.0.18.0 + - run: opam install ocamlformat.0.22.4 - run: opam exec -- make fmt-check - run: opam pin add coq ${{ matrix.coq-version }} - run: opam pin add coq-of-ocaml.dev . --no-action diff --git a/.ocamlformat b/.ocamlformat index d8047b2c..4e4d8739 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1 +1 @@ -version=0.20.1 +version=0.22.4 diff --git a/src/adtConstructors.ml b/src/adtConstructors.ml index dd8e1feb..45725766 100644 --- a/src/adtConstructors.ml +++ b/src/adtConstructors.ml @@ -176,9 +176,8 @@ let of_ocaml_case (typ_name : Name.t) (attributes : Attribute.t list) let typs = List.map (fun t -> fst t) typs in return (typs, new_typ_vars) | _ -> - raise - ([ ty ], new_typ_vars) - Error.Category.Unexpected "Unexpected Type of Constructor") + raise ([ ty ], new_typ_vars) Error.Category.Unexpected + "Unexpected Type of Constructor") | None -> let kind = if is_tagged then Kind.Tag else Kind.Set in let typ_args = AdtParameters.get_parameters defined_typ_params in diff --git a/src/constant.ml b/src/constant.ml index afde2ea6..92e44a41 100644 --- a/src/constant.ml +++ b/src/constant.ml @@ -78,11 +78,11 @@ let rec to_coq_s (need_parens : bool) (xs : parsed_string list) : SmartPrint.t = | PChar c :: xs -> let res = npchar c ^^ nest @@ to_coq_s true xs in if need_parens then parens res else res - | PDQuote :: xs -> to_coq_s need_parens @@ PString "\"\"" :: xs + | PDQuote :: xs -> to_coq_s need_parens @@ (PString "\"\"" :: xs) | PString s :: PDQuote :: xs -> - to_coq_s need_parens @@ PString (s ^ "\"\"") :: xs + to_coq_s need_parens @@ (PString (s ^ "\"\"") :: xs) | PString s1 :: PString s2 :: xs -> - to_coq_s need_parens @@ PString (s1 ^ s2) :: xs + to_coq_s need_parens @@ (PString (s1 ^ s2) :: xs) | [ PString s ] -> double_quotes !^s | PString s :: xs -> double_quotes !^s ^^ !^"++" ^^ nest @@ to_coq_s false xs diff --git a/src/structure.ml b/src/structure.ml index 76cd76ab..4cb33829 100644 --- a/src/structure.ml +++ b/src/structure.ml @@ -210,7 +210,7 @@ let wrap_documentation (items : t list Monad.t) : t list Monad.t = match documentation with | None -> items | Some documentation -> - let* items in + let* items = items in return [ Documentation (documentation, items) ] let top_level_evaluation (e : expression) : t list Monad.t =