Skip to content

Commit

Permalink
Support Include Module Type with
Browse files Browse the repository at this point in the history
  • Loading branch information
Villetaneuse committed May 16, 2024
1 parent 886e8b5 commit d68020b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/sphinx/language/core/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ are now available through the dot notation.
#. Assumptions such as :cmd:`Axiom` that include the :n:`Inline` clause will be automatically
expanded when the functor is applied, except when the function application is prefixed by ``!``.

.. cmd:: Include @module_type_inl {* <+ @module_expr_inl }
.. cmd:: Include @module_type_inl {* <+ @module_type_inl }

Includes the content of module(s) in the current
interactive module. Here :n:`@module_type_inl` can be a module expression or a module
Expand Down
2 changes: 1 addition & 1 deletion doc/tools/docgram/fullGrammar
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ gallina_ext: [
| "From" global "Require" export_token LIST1 filtered_import
| "Import" OPT import_categories LIST1 filtered_import
| "Export" OPT import_categories LIST1 filtered_import
| "Include" module_type_inl LIST0 ext_module_expr
| "Include" module_type_inl LIST0 ext_module_type
| "Transparent" OPT "!" LIST1 smart_global
| "Opaque" OPT "!" LIST1 smart_global
| "Strategy" LIST1 [ strategy_level "[" LIST1 smart_global "]" ]
Expand Down
2 changes: 1 addition & 1 deletion doc/tools/docgram/orderedGrammar
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ command: [
| OPT [ "From" dirpath ] "Require" OPT ( [ "Import" | "Export" ] OPT import_categories ) LIST1 filtered_import
| "Import" OPT import_categories LIST1 filtered_import
| "Export" OPT import_categories LIST1 filtered_import
| "Include" module_type_inl LIST0 ( "<+" module_expr_inl )
| "Include" module_type_inl LIST0 ( "<+" module_type_inl )
| "Transparent" OPT "!" LIST1 reference
| "Opaque" OPT "!" LIST1 reference
| "Strategy" LIST1 [ strategy_level "[" LIST1 reference "]" ]
Expand Down
14 changes: 14 additions & 0 deletions test-suite/modules/include_module_type.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Module Type type1.
Parameter A : Prop.
End type1.

Module Type type2.
Parameter B : Prop.
End type2.

Module Type type3 := type1 <+ type2 with Definition B := True.
Print type3.

Module Type type3''.
Include type1 <+ type2 with Definition B := True.
End type3''.
2 changes: 1 addition & 1 deletion vernac/g_vernac.mlg
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ GRAMMAR EXTEND Gram
{ VernacSynterp (VernacImport ((Import,cats),qidl)) }
| IDENT "Export"; cats = OPT import_categories; qidl = LIST1 filtered_import ->
{ VernacSynterp (VernacImport ((Export,cats),qidl)) }
| IDENT "Include"; e = module_type_inl; l = LIST0 ext_module_expr ->
| IDENT "Include"; e = module_type_inl; l = LIST0 ext_module_type ->
{ VernacSynterp (VernacInclude(e::l)) } ] ]
;
import_categories:
Expand Down

0 comments on commit d68020b

Please sign in to comment.