Skip to content

Commit

Permalink
[ocaml] put softline before modules in module type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
nbacquey committed Oct 23, 2023
1 parent bb3ba08 commit 1d5c062
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions topiary-queries/queries/ocaml.scm
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@
(signature
"sig" @append_spaced_softline
[
(module_definition)
(value_specification)
(type_definition)
; start equivalence class
Expand Down
3 changes: 2 additions & 1 deletion topiary/tests/samples/expected/ocaml-interface.mli
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,8 @@ module Dal: sig
context -> (context * Attestation.t) tzresult Lwt.t
end

module Operations: sig module Publish_slot_header: sig
module Operations: sig
module Publish_slot_header: sig
type t = {
published_level: Raw_level.t;
slot_index: Slot_index.t;
Expand Down
13 changes: 13 additions & 0 deletions topiary/tests/samples/expected/ocaml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,19 @@ let _ =
| F ->
bar

(* #644: softlines before module definition in a module type *)
module type F = sig
module G: sig val h : string end

type ('state, 'proof, 'output) implementation =
(
module S with
type state = 'state
and type proof = 'proof
and type output_proof = 'output
)
end

(* #645: idempotency error on first-class module types *)
let peer_functor : (module Peer.F) =
if !listening then (module Server) else (module Client)
Expand Down
13 changes: 13 additions & 0 deletions topiary/tests/samples/input/ocaml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,19 @@ let _ =
| A | B | C
| D | E | F -> bar

(* #644: softlines before module definition in a module type *)
module type F = sig
module G : sig val h : string end

type ('state, 'proof, 'output) implementation =
(
module S with
type state = 'state
and type proof = 'proof
and type output_proof = 'output
)
end

(* #645: idempotency error on first-class module types *)
let peer_functor : (module Peer.F) =
if !listening then (module Server) else (module Client)
Expand Down

0 comments on commit 1d5c062

Please sign in to comment.