aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEnrico Tassi2019-11-22 10:40:40 +0100
committerEnrico Tassi2019-12-02 16:04:26 +0100
commitbfae260f7ba026e17e0cc599b8507bd133c4edc0 (patch)
treed59d6d36639f2e5b58ab7370863bd8ef1e91f1d6 /doc
parent27e4f306d54f2cc04b40d740584a7b3eda2d490a (diff)
[CS] support #[local] attribute
Diffstat (limited to 'doc')
-rw-r--r--doc/changelog/07-commands-and-options/11162-local-cs.rst1
-rw-r--r--doc/sphinx/language/gallina-extensions.rst7
2 files changed, 5 insertions, 3 deletions
diff --git a/doc/changelog/07-commands-and-options/11162-local-cs.rst b/doc/changelog/07-commands-and-options/11162-local-cs.rst
new file mode 100644
index 0000000000..5a69a107cd
--- /dev/null
+++ b/doc/changelog/07-commands-and-options/11162-local-cs.rst
@@ -0,0 +1 @@
+- Handle the ``#[local]`` attribute in :g:`Canonical Structure` declarations (`#11162 <https://github.com/coq/coq/pull/11162>`_, by Enrico Tassi).
diff --git a/doc/sphinx/language/gallina-extensions.rst b/doc/sphinx/language/gallina-extensions.rst
index ae0afc7819..8caa289a47 100644
--- a/doc/sphinx/language/gallina-extensions.rst
+++ b/doc/sphinx/language/gallina-extensions.rst
@@ -2003,10 +2003,11 @@ applied to an unknown structure instance (an implicit argument) and a
value. The complete documentation of canonical structures can be found
in :ref:`canonicalstructures`; here only a simple example is given.
-.. cmd:: Canonical {? Structure } @qualid
+.. cmd:: {? Local | #[local] } Canonical {? Structure } @qualid
This command declares :token:`qualid` as a canonical instance of a
- structure (a record).
+ structure (a record). When the :g:`#[local]` attribute is given the effect
+ stops at the end of the :g:`Section` containig it.
Assume that :token:`qualid` denotes an object ``(Build_struct`` |c_1| … |c_n| ``)`` in the
structure :g:`struct` of which the fields are |x_1|, …, |x_n|.
@@ -2069,7 +2070,7 @@ in :ref:`canonicalstructures`; here only a simple example is given.
See :ref:`canonicalstructures` for a more realistic example.
- .. cmdv:: Canonical {? Structure } @ident {? : @type } := @term
+ .. cmdv:: {? Local | #[local] } Canonical {? Structure } @ident {? : @type } := @term
This is equivalent to a regular definition of :token:`ident` followed by the
declaration :n:`Canonical @ident`.