Skip to content

Commit aed7081

Browse files
committed
Merge remote-tracking branch 'spec/main'
2 parents e6f42fc + 1041527 commit aed7081

File tree

20 files changed

+132
-53
lines changed

20 files changed

+132
-53
lines changed

document/core/binary/conventions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ In order to distinguish symbols of the binary syntax from symbols of the abstrac
5858

5959
* Productions are written :math:`\B{sym} ::= B_1 \Rightarrow A_1 ~|~ \dots ~|~ B_n \Rightarrow A_n`, where each :math:`A_i` is the attribute that is synthesized for :math:`\B{sym}` in the given case, usually from attribute variables bound in :math:`B_i`.
6060

61+
* Large productions may be split into multiple definitions, indicated by ending the first one with explicit ellipses, :math:`\B{sym} ::= B_1 \Rightarrow A_1 ~|~ \dots`, and starting continuations with ellipses, :math:`\B{sym} ::= \dots ~|~ B_2 \Rightarrow A_2`.
62+
6163
* Some productions are augmented by side conditions in parentheses, which restrict the applicability of the production. They provide a shorthand for a combinatorial expansion of the production into many separate cases.
6264

6365
* If the same meta variable or non-terminal symbol appears multiple times in a production (in the syntax or in an attribute), then all those occurrences must have the same instantiation.

document/core/binary/instructions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ Control Instructions
6262
&\Rightarrow& \BRTABLE~l^\ast~l_N \\ &&|&
6363
\hex{0F} &\Rightarrow& \RETURN \\ &&|&
6464
\hex{10}~~x{:}\Bfuncidx &\Rightarrow& \CALL~x \\ &&|&
65-
\hex{11}~~y{:}\Btypeidx~~x{:}\Btableidx &\Rightarrow& \CALLINDIRECT~x~y \\
65+
\hex{11}~~y{:}\Btypeidx~~x{:}\Btableidx &\Rightarrow& \CALLINDIRECT~x~y \\ &&|&
66+
\dots
6667
\end{array}
6768
6869
.. note::

document/core/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
name = 'WebAssembly'
6161
project = u'WebAssembly'
6262
title = u'WebAssembly Specification'
63-
copyright = u'2024, WebAssembly Community Group'
63+
copyright = u'2025, WebAssembly Community Group'
6464
author = u'WebAssembly Community Group'
6565
editor = u'Andreas Rossberg (editor)'
6666
logo = 'static/webassembly.png'

document/core/exec/instructions.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@ Control Instructions
26222622

26232623
6. Pop the values :math:`\val^m` from the stack.
26242624

2625-
7. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\val^m~\instr^\ast` with label :math:`L`.
2625+
7. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\instr^\ast` with label :math:`L` and values :math:`\val^m`.
26262626

26272627
.. math::
26282628
~\\[-1ex]
@@ -2650,7 +2650,7 @@ Control Instructions
26502650

26512651
6. Pop the values :math:`\val^m` from the stack.
26522652

2653-
7. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\val^m~\instr^\ast` with label :math:`L`.
2653+
7. :ref:`Enter <exec-instr-seq-enter>` the block :math:`\instr^\ast` with label :math:`L` and values :math:`\val^m`.
26542654

26552655
.. math::
26562656
~\\[-1ex]
@@ -2918,12 +2918,14 @@ that forms a :ref:`block <exec-instr-control>`.
29182918

29192919
.. _exec-instr-seq-enter:
29202920

2921-
Entering :math:`\instr^\ast` with label :math:`L`
2922-
.................................................
2921+
Entering :math:`\instr^\ast` with label :math:`L` and values :math:`\val^\ast`
2922+
..............................................................................
29232923

29242924
1. Push :math:`L` to the stack.
29252925

2926-
2. Jump to the start of the instruction sequence :math:`\instr^\ast`.
2926+
2. Push the values :math:`\val^\ast` to the stack.
2927+
2928+
3. Jump to the start of the instruction sequence :math:`\instr^\ast`.
29272929

29282930
.. note::
29292931
No formal reduction rule is needed for entering an instruction sequence,
@@ -2993,7 +2995,7 @@ Invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
29932995

29942996
10. Let :math:`L` be the :ref:`label <syntax-label>` whose arity is :math:`m` and whose continuation is the end of the function.
29952997

2996-
11. :ref:`Enter <exec-instr-seq-enter>` the instruction sequence :math:`\instr^\ast` with label :math:`L`.
2998+
11. :ref:`Enter <exec-instr-seq-enter>` the instruction sequence :math:`\instr^\ast` with label :math:`L` and no values.
29972999

29983000
.. math::
29993001
~\\[-1ex]

document/core/syntax/instructions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ Instructions in this group can operate on operands of any :ref:`value type <synt
459459
The |DROP| instruction simply throws away a single operand.
460460

461461
The |SELECT| instruction selects one of its first two operands based on whether its third operand is zero or not.
462-
It may include a :ref:`value type <syntax-valtype>` determining the type of these operands. If missing, the operands must be of :ref:`numeric type <syntax-numtype>`.
462+
It may include a :ref:`value type <syntax-valtype>` determining the type of these operands.
463+
If missing, the operands must be of :ref:`numeric <syntax-numtype>` or :ref:`vector <syntax-vectype>` type.
463464

464465
.. note::
465466
In future versions of WebAssembly, the type annotation on |SELECT| may allow for more than a single value being selected at the same time.

document/core/text/conventions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ In order to distinguish symbols of the textual syntax from symbols of the abstra
5353

5454
* Productions are written :math:`\T{sym} ::= T_1 \Rightarrow A_1 ~|~ \dots ~|~ T_n \Rightarrow A_n`, where each :math:`A_i` is the attribute that is synthesized for :math:`\T{sym}` in the given case, usually from attribute variables bound in :math:`T_i`.
5555

56+
* Large productions may be split into multiple definitions, indicated by ending the first one with explicit ellipses, :math:`\T{sym} ::= T_1 \Rightarrow A_1 ~|~ \dots`, and starting continuations with ellipses, :math:`\T{sym} ::= \dots ~|~ T_2 \Rightarrow A_2`.
57+
5658
* Some productions are augmented by side conditions in parentheses, which restrict the applicability of the production. They provide a shorthand for a combinatorial expansion of the production into many separate cases.
5759

5860
* If the same meta variable or non-terminal symbol appears multiple times in a production (in the syntax or in an attribute), then all those occurrences must have the same instantiation.

document/core/text/instructions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ All other control instruction are represented verbatim.
118118
\text{return} &\Rightarrow& \RETURN \\ &&|&
119119
\text{call}~~x{:}\Tfuncidx_I &\Rightarrow& \CALL~x \\ &&|&
120120
\text{call\_indirect}~~x{:}\Ttableidx~~y,I'{:}\Ttypeuse_I &\Rightarrow& \CALLINDIRECT~x~y
121-
& (\iff I' = \{\ILOCALS~(\epsilon)^\ast\}) \\
121+
& (\iff I' = \{\ILOCALS~(\epsilon)^\ast\}) \\ &&|&
122+
\dots
122123
\end{array}
123124
124125
.. note::

document/core/util/mathjax2katex.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ def HasBalancedTags(s):
6161

6262
def ReplaceMath(cache, data):
6363
old = data
64+
data = re.sub('[\\\\]\\[([0-9]|-)', '\\\\DOUBLESLASH\\[\\1', data) # Messed up by Bikeshed
6465
data = data.replace('\\\\', '\\DOUBLESLASH')
6566
data = data.replace('\\(', '')
6667
data = data.replace('\\)', '')
6768
data = data.replace('\\[', '')
6869
data = data.replace('\\]', '')
6970
data = data.replace('\\DOUBLESLASH', '\\\\')
70-
data = data.replace('’', '\\text{’}')
71-
data = data.replace('‘', '\\text{‘}')
72-
data = data.replace('\\hfill', '')
71+
data = data.replace('\u2019', '\'') # "Right Single Quotation Mark" messed up by Bikeshed
72+
data = data.replace('\\hfill', ' ')
7373
data = data.replace('\\mbox', '\\text')
7474
data = data.replace('\\begin{split}', '\\begin{aligned}')
7575
data = data.replace('\\end{split}', '\\end{aligned}')
76-
data = data.replace('&amp;', '&')
77-
data = data.replace('&lt;', '<')
78-
data = data.replace('&gt;', '>')
76+
data = data.replace('&amp;', '&') # Messed up by Bikeshed
77+
data = data.replace('&lt;', '<') # Messed up by Bikeshed
78+
data = data.replace('&gt;', '>') # Messed up by Bikeshed
7979
data = data.replace('{array}[t]', '{array}')
8080
data = data.replace('{array}[b]', '{array}')
8181
data = data.replace('@{~}', '')
@@ -108,12 +108,17 @@ def ReplaceMath(cache, data):
108108
data = data[:start] + v.replace('#1', data[start+len(k):end]) + data[end:]
109109
p = subprocess.Popen(
110110
['node', os.path.join(SCRIPT_DIR, 'katex/cli.js'), '--display-mode', '--trust'],
111-
stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
112-
ret = p.communicate(input=data)[0]
113-
if p.returncode != 0:
111+
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
112+
ret, err = p.communicate(input=data)
113+
if p.returncode != 0 or err != "":
114+
if err != "":
115+
sys.stderr.write('\n\n' + err + '\n')
114116
sys.stderr.write('BEFORE:\n' + old + '\n')
115117
sys.stderr.write('AFTER:\n' + data + '\n')
116-
raise Exception()
118+
if p.returncode != 0:
119+
raise Exception()
120+
else:
121+
sys.stderr.write('RESULT:\n' + ret + '\n')
117122
ret = ret.strip()
118123
ret = ret[ret.find('<span class="katex-html"'):]
119124
ret = '<span class="katex-display"><span class="katex">' + ret
@@ -207,7 +212,7 @@ def ExtractMath(match):
207212
# Pull out math fragments.
208213
data = re.sub(
209214
'class="([^"]*)math([^"]*)"[^>]*>'
210-
'((?:[ ]*<span[^>]*>[^<]*</span>)*)([^<]*)<',
215+
'((?:[ \n]*<span[^>]*>[^<]*</span>)*)([^<]*)<',
211216
ExtractMath, data)
212217

213218
sys.stderr.write('Processing %d fragments.\n' % len(fixups))
@@ -223,7 +228,8 @@ def Worker():
223228
fixed = ('class="' + cls_before + ' ' + cls_after + '">' +
224229
spans + ReplaceMath(cache, mth) + '<')
225230
done_fixups.append((start, end, fixed))
226-
except Exception:
231+
except Exception as inst:
232+
sys.stderr.write('\nException: ' + inst.__str__() + '\n')
227233
success = False
228234

229235
q.task_done()
41.1 KB
Binary file not shown.

interpreter/Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,24 @@ quiettest/%: $(NAME)
9797
.PHONY: install
9898

9999
install:
100+
rm -f $(NAME).exe
100101
dune build -p $(NAME) @install
101102
dune install
102103

103104
opam-release/%:
104-
git tag opam-$*
105-
git push --tags
105+
#git tag -f opam-$*
106+
#git push -f --tags
106107
rm -f opam-$*.zip
107-
wget https://github.com/WebAssembly/spec/archive/opam-$*.zip
108+
#wget https://github.com/WebAssembly/spec/archive/opam-$*.zip
109+
wget 'https://download-directory.github.io?url=https://github.com/WebAssembly/spec/tree/opam-$*/interpreter&filename=opam-$*.zip'
108110
cp wasm.opam opam
109111
echo "url {" >> opam
110-
echo " src: \"https://github.com/WebAssembly/spec/archive/opam-$*.zip\"" >> opam
111-
echo " checksum: \"md5=`md5 -q opam-$*.zip`\"" >> opam
112+
#echo " src: \"https://github.com/WebAssembly/spec/archive/opam-$*.zip\"" >> opam
113+
echo " src: \"https://download-directory.github.io?url=https://github.com/WebAssembly/spec/tree/opam-$*/interpreter&filename=opam-$*.zip\"" >> opam
114+
echo " checksum: [" >> opam
115+
echo " \"md5=`md5 -q opam-$*.zip`\"" >> opam
116+
echo " \"sha256=`sha256 -q opam-$*.zip`\"" >> opam
117+
echo " ]" >> opam
112118
echo "}" >> opam
113119
rm opam-$*.zip
114120
@echo Created file ./opam, submit to github opam-repository/packages/wasm/wasm.$*/opam

0 commit comments

Comments
 (0)