Skip to content

Fix typos in binary and text formats #1469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion document/core/binary/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ The |VCONST| instruction is followed by 16 immediate bytes, which are converted
\begin{array}{llclll}
\production{instruction} & \Binstr &::=& \dots \\&&|&
\hex{FD}~~12{:}\Bu32~~(b{:}\Bbyte)^{16} &\Rightarrow& \V128.\VCONST~
bytes_{\K{i128}}^{-1}(b_{0}~\dots~b_{15}) \\
\bytes_{\K{i128}}^{-1}(b_{0}~\dots~b_{15}) \\
\end{array}

.. _binary-vternop:
Expand Down
8 changes: 4 additions & 4 deletions document/core/binary/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
.. math::
\begin{array}{llclll}
\production{element section} & \Belemsec &::=&
\X{seg}^\ast{:}\Bsection_9(\Bvec(\Belem)) &\Rightarrow& \X{seg} \\
\X{seg}^\ast{:}\Bsection_9(\Bvec(\Belem)) &\Rightarrow& \X{seg}^\ast \\
\production{element segment} & \Belem &::=&
0{:}\Bu32~~e{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
&\Rightarrow& \\&&&\quad
Expand Down Expand Up @@ -406,7 +406,7 @@ denoting *count* locals of the same value type.
&\Rightarrow& \X{code} & (\iff \X{size} = ||\Bfunc||) \\
\production{function} & \Bfunc &::=&
(t^\ast)^\ast{:}\Bvec(\Blocals)~~e{:}\Bexpr
&\Rightarrow& \concat((t^\ast)^\ast), e^\ast
&\Rightarrow& \concat((t^\ast)^\ast), e
& (\iff |\concat((t^\ast)^\ast)| < 2^{32}) \\
\production{locals} & \Blocals &::=&
n{:}\Bu32~~t{:}\Bvaltype &\Rightarrow& t^n \\
Expand Down Expand Up @@ -438,7 +438,7 @@ It decodes into a vector of :ref:`data segments <syntax-data>` that represent th
.. math::
\begin{array}{llclll}
\production{data section} & \Bdatasec &::=&
\X{seg}^\ast{:}\Bsection_{11}(\Bvec(\Bdata)) &\Rightarrow& \X{seg} \\
\X{seg}^\ast{:}\Bsection_{11}(\Bvec(\Bdata)) &\Rightarrow& \X{seg}^\ast \\
\production{data segment} & \Bdata &::=&
0{:}\Bu32~~e{:}\Bexpr~~b^\ast{:}\Bvec(\Bbyte)
&\Rightarrow& \{ \DINIT~b^\ast, \DMODE~\DACTIVE~\{ \DMEM~0, \DOFFSET~e \} \} \\ &&|&
Expand Down Expand Up @@ -504,7 +504,7 @@ All sections can be empty.
The lengths of vectors produced by the (possibly empty) :ref:`function <binary-funcsec>` and :ref:`code <binary-codesec>` section must match up.

Similarly, the optional data count must match the length of the :ref:`data segment <binary-datasec>` vector.
Furthermore, it must be present if any :math:`data index <syntax-dataidx>` occurs in the code section.
Furthermore, it must be present if any :ref:`data index <syntax-dataidx>` occurs in the code section.

.. math::
\begin{array}{llcllll}
Expand Down
2 changes: 1 addition & 1 deletion document/core/binary/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Value Types
Result Types
~~~~~~~~~~~~

:ref:`Result types <syntax-resulttype>` are encoded by the respective :ref:`vectors <binary-vec>` of :ref:`value types `<binary-valtype>`.
:ref:`Result types <syntax-resulttype>` are encoded by the respective :ref:`vectors <binary-vec>` of :ref:`value types <binary-valtype>`.

.. math::
\begin{array}{llclll@{\qquad\qquad}l}
Expand Down
2 changes: 1 addition & 1 deletion document/core/binary/values.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ As an additional constraint, the total number of bytes encoding a value of type
.. math::
\begin{array}{llclll@{\qquad\qquad}l}
\production{uninterpreted integer} & \BiN &::=&
n{:}\BsN &\Rightarrow& i & (\iff n = \signed_{\iN}(i))
n{:}\BsN &\Rightarrow& i & (\iff n = \signed_N(i))
\end{array}

.. note::
Expand Down
20 changes: 10 additions & 10 deletions document/core/text/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,18 @@ Table Instructions
Abbreviations
.............

For backwards compatibility, all :math:`table indices <syntax-tableidx>` may be omitted from table instructions, defaulting to :math:`0`.
For backwards compatibility, all :ref:`table indices <syntax-tableidx>` may be omitted from table instructions, defaulting to :math:`0`.

.. math::
\begin{array}{llclll}
\begin{array}{llcl}
\production{instruction} &
\text{table.get} &\equiv& \text{table.get}~~\text{0} \\ &&|&
\text{table.set} &\equiv& \text{table.set}~~\text{0} \\ &&|&
\text{table.size} &\equiv& \text{table.size}~~\text{0} \\ &&|&
\text{table.grow} &\equiv& \text{table.grow}~~\text{0} \\ &&|&
\text{table.fill} &\equiv& \text{table.fill}~~\text{0} \\ &&|&
\text{table.copy} &\equiv& \text{table.copy}~~\text{0}~~\text{0} \\ &&|&
\text{table.init}~~x{:}\Telemidx_I &\equiv& \text{table.init}~~\text{0}~~x{:}\Telemidx_I \\ &&|&
\text{table.get} &\equiv& \text{table.get}~~\text{0} \\ &
\text{table.set} &\equiv& \text{table.set}~~\text{0} \\ &
\text{table.size} &\equiv& \text{table.size}~~\text{0} \\ &
\text{table.grow} &\equiv& \text{table.grow}~~\text{0} \\ &
\text{table.fill} &\equiv& \text{table.fill}~~\text{0} \\ &
\text{table.copy} &\equiv& \text{table.copy}~~\text{0}~~\text{0} \\ &
\text{table.init}~~x{:}\Telemidx_I &\equiv& \text{table.init}~~\text{0}~~x{:}\Telemidx_I \\
\end{array}


Expand Down Expand Up @@ -916,7 +916,7 @@ Such a folded instruction can appear anywhere a regular instruction can.
\text{(}~\text{loop}~~\Tlabel~~\Tblocktype~~\Tinstr^\ast~\text{)}
&\equiv\quad \text{loop}~~\Tlabel~~\Tblocktype~~\Tinstr^\ast~~\text{end} \\ &
\text{(}~\text{if}~~\Tlabel~~\Tblocktype~~\Tfoldedinstr^\ast
&\hspace{-3ex} \text{(}~\text{then}~~\Tinstr_1^\ast~\text{)}~~\text{(}~\text{else}~~\Tinstr_2^\ast~\text{)}^?~~\text{)}
&\hspace{-3ex} \text{(}~\text{then}~~\Tinstr_1^\ast~\text{)}~~(\text{(}~\text{else}~~\Tinstr_2^\ast~\text{)})^?~~\text{)}
\quad\equiv \\ &\qquad
\Tfoldedinstr^\ast~~\text{if}~~\Tlabel~~\Tblocktype &\hspace{-1ex} \Tinstr_1^\ast~~\text{else}~~(\Tinstr_2^\ast)^?~\text{end} \\
\end{array}
Expand Down