You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETFUNC~\functype_1` and :math:`\ETFUNC~\functype_2` respectively:
147
+
148
+
a. Return true if and only if :math:`\vdashexterntypematch\ETFUNC~\functype_1\matchesexterntype\ETFUNC~\functype_2`.
149
+
150
+
2. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETTABLE~\tabletype_1` and :math:`\ETTABLE~\tabletype_2` respectively:
151
+
152
+
a. Return true if and only if :math:`\vdashexterntypematch\ETTABLE~\tabletype_1\matchesexterntype\ETTABLE~\tabletype_2`.
153
+
154
+
3. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETMEM~\memtype_1` and :math:`\ETMEM~\memtype_2` respectively:
155
+
156
+
a. Return true if and only if :math:`\vdashexterntypematch\ETMEM~\memtype_1\matchesexterntype\ETMEM~\memtype_2`.
157
+
158
+
4. If :math:`\externtype_1` and :math:`\externtype_2` are both of the form :math:`\ETGLOBAL~\globaltype_1` and :math:`\ETGLOBAL~\globaltype_2` respectively:
159
+
160
+
a. Return true if and only if :math:`\vdashexterntypematch\ETGLOBAL~\globaltype_1\matchesexterntype\ETGLOBAL~\globaltype_2`.
This function encapsulates the external type matching relation defined in the core specification. It allows for checking compatibility of external types when linking modules or validating imports against exports. The current implementation uses the exact matching rules from the core specification, but this function provides a single point for potential future extensions to the type system.
Copy file name to clipboardExpand all lines: document/core/syntax/modules.rst
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,7 +327,7 @@ The |MSTART| component of a module declares the :ref:`function index <syntax-fun
327
327
The module and its exports are not accessible externally before this initialization has completed.
328
328
329
329
330
-
.. index:: ! export, name, index, function index, table index, memory index, global index, function, table, memory, global, instantiation
330
+
.. index:: ! export, direct export, indirect export, re-export, name, index, function index, table index, memory index, global index, function, table, memory, global, instantiation
331
331
pair: abstract syntax; export
332
332
single: function; export
333
333
single: table; export
@@ -356,6 +356,32 @@ Each export is labeled by a unique :ref:`name <syntax-name>`.
356
356
Exportable definitions are :ref:`functions <syntax-func>`, :ref:`tables <syntax-table>`, :ref:`memories <syntax-mem>`, and :ref:`globals <syntax-global>`,
357
357
which are referenced through a respective descriptor.
358
358
359
+
A *direct export* is one where the export references a function, table, memory, or global instance that is defined within the module itself rather than being imported.
360
+
361
+
An *indirect export* (or *re-export*) is one where the export references a function, table, memory, or global that the module imports.
362
+
363
+
The import corresponding to an export description is given by:
364
+
365
+
.. math::
366
+
\begin{array}{lllll}
367
+
\production{import for export} & \importforexport(m, \exportdesc) &=&
0 commit comments