Skip to content

Commit

Permalink
Default modalities and simple modal modules (#97)
Browse files Browse the repository at this point in the history
* Add tests for default modalities.

Signed-off-by: Thomas Del Vecchio <[email protected]>

* Implement default modalities.

Signed-off-by: Thomas Del Vecchio <[email protected]>

* Add more tests.

Signed-off-by: Thomas Del Vecchio <[email protected]>

* Add tests for basic modal modules.

Signed-off-by: Thomas Del Vecchio <[email protected]>

* Implement basic modal modules.

Signed-off-by: Thomas Del Vecchio <[email protected]>

* Add regression tests, fix issues with comments causing non-stability, fix issue with default modalities in empty signatures.

Signed-off-by: Thomas Del Vecchio <[email protected]>

---------

Signed-off-by: Thomas Del Vecchio <[email protected]>
  • Loading branch information
tdelvecchio-jsc authored Feb 4, 2025
1 parent c3879ad commit 71a16e2
Show file tree
Hide file tree
Showing 49 changed files with 1,004 additions and 109 deletions.
4 changes: 2 additions & 2 deletions lib/Ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ let doc_atrs ?(acc = []) atrs =

let rec mty_is_simple x =
match x.pmty_desc with
| Pmty_ident _ | Pmty_alias _ | Pmty_signature [] -> true
| Pmty_signature (_ :: _)
| Pmty_ident _ | Pmty_alias _ | Pmty_signature {psg_items= []; _} -> true
| Pmty_signature {psg_items= _ :: _; _}
|Pmty_with (_, _ :: _ :: _)
|Pmty_extension _
|Pmty_functor (_, _)
Expand Down
4 changes: 2 additions & 2 deletions lib/Chunk.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
open Extended_ast

type 'a item =
| Structure : Extended_ast.structure item
| Signature : Extended_ast.signature item
| Structure : Extended_ast.structure_item list item
| Signature : Extended_ast.signature_item list item
| Use_file : Extended_ast.use_file item

type 'a t =
Expand Down
4 changes: 2 additions & 2 deletions lib/Chunk.mli
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
(**************************************************************************)

type 'a item =
| Structure : Extended_ast.structure item
| Signature : Extended_ast.signature item
| Structure : Extended_ast.structure_item list item
| Signature : Extended_ast.signature_item list item
| Use_file : Extended_ast.use_file item

type 'a t =
Expand Down
2 changes: 1 addition & 1 deletion lib/Exposed.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module Right = struct

let payload = function
| PStr items -> list ~elt:structure_item items
| PSig items -> list ~elt:signature_item items
| PSig {psg_items; _} -> list ~elt:signature_item psg_items
| PTyp t -> core_type t
| PPat _ -> false
end
Loading

0 comments on commit 71a16e2

Please sign in to comment.