Skip to content

Commit

Permalink
Update docs to allow import/export mut globals (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
binji authored Nov 17, 2017
1 parent 07a6fb2 commit 5d2ad6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
6 changes: 0 additions & 6 deletions document/core/syntax/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ Each export is identified by a unique :ref:`name <syntax-name>`.
Exportable definitions are :ref:`functions <syntax-func>`, :ref:`tables <syntax-table>`, :ref:`memories <syntax-mem>`, and :ref:`globals <syntax-global>`,
which are referenced through a respective descriptor.

.. note::
In the current version of WebAssembly, only *immutable* globals may be exported.


Conventions
...........
Expand Down Expand Up @@ -360,6 +357,3 @@ Each import is specified by a descriptor with a respective type that a definitio

Every import defines an index in the respective :ref:`index space <syntax-index>`.
In each index space, the indices of imports go before the first index of any definition contained in the module itself.

.. note::
In the current version of WebAssembly, only *immutable* globals may be imported.
14 changes: 4 additions & 10 deletions document/core/valid/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,13 @@ Exports :math:`\export` and export descriptions :math:`\exportdesc` are classifi

* The global :math:`C.\CGLOBALS[x]` must be defined in the context.

* Let :math:`\mut~t` be the :ref:`global type <syntax-globaltype>` :math:`C.\CGLOBALS[x]`.

* The mutability :math:`\mut` must be |MCONST|.

* Then the export description is valid with :ref:`external type <syntax-externtype>` :math:`\ETGLOBAL~C.\CGLOBALS[x]`.

.. math::
\frac{
C.\CGLOBALS[x] = \MCONST~t
C.\CGLOBALS[x] = \ETGLOBAL~\globaltype
}{
C \vdashexportdesc \EDGLOBAL~x : \ETGLOBAL~(\MCONST~t)
C \vdashexportdesc \EDGLOBAL~x : \ETGLOBAL~\globaltype
}
Expand Down Expand Up @@ -414,15 +410,13 @@ Imports :math:`\import` and import descriptions :math:`\importdesc` are classifi

* The global type :math:`\globaltype` must be :ref:`valid <valid-globaltype>`.

* The mutability of :math:`\globaltype` must be |MCONST|.

* Then the import description is valid with type :math:`\ETGLOBAL~\globaltype`.

.. math::
\frac{
\vdashglobaltype \MCONST~t \ok
\vdashglobaltype \globaltype \ok
}{
C \vdashimportdesc \IDGLOBAL~\MCONST~t : \ETGLOBAL~\MCONST~t
C \vdashimportdesc \IDGLOBAL~\globaltype : \ETGLOBAL~\globaltype
}
Expand Down

0 comments on commit 5d2ad6e

Please sign in to comment.