Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from xtuc/sequence-multi-value
Browse files Browse the repository at this point in the history
Rebase from upstream and adapt limits
  • Loading branch information
littledan committed Mar 18, 2019
2 parents b901055 + b725dbf commit 983320a
Show file tree
Hide file tree
Showing 189 changed files with 17,593 additions and 7,307 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sudo: on

install:
- ./interpreter/meta/travis/install-ocaml.sh
- sudo pip install sphinx
- sudo pip install sphinx==1.7.9
- sudo apt-get install texlive-full
- git clone https://github.com/tabatkins/bikeshed.git
- pip install --editable $PWD/bikeshed
Expand Down
7 changes: 7 additions & 0 deletions document/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ publish: all deploy
clean: $(DIRS:%=clean-%)
rm -rf $(BUILDDIR)

.PHONY: diff
diff: $(DIRS:%=diff-%)


# Directory-specific targets.

Expand Down Expand Up @@ -54,6 +57,10 @@ $(DIRS:%=clean-%): clean-%:
(cd $(@:clean-%=%); make BUILDDIR=$(BUILDDIR) clean)
rm -rf $(BUILDDIR)/$(@:clean-%=%)

.PHONY: $(DIRS:%=diff-%)
$(DIRS:%=diff-%): diff-%:
(cd $(@:diff-%=%); make BUILDDIR=$(BUILDDIR) diff)


# Help.

Expand Down
44 changes: 44 additions & 0 deletions document/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ usage:
@echo " html to make standalone HTML files"
@echo " pdf to make standalone PDF file"
@echo " bikeshed to make a bikeshed wrapped single large HTML file"
@echo " diff to make a diff of the bikeshed HTML file with the latest TR"
@echo " WD-tar generate tar file for updating the Working Draft"
@echo " WD-echidna publish the Working Draft tar file via Echidna"
@echo " all to make all 3"
@echo " publish to make all and push to gh-pages"
@echo " help to see more options"
Expand Down Expand Up @@ -139,6 +142,8 @@ singlehtml:
bikeshed:
$(SPHINXBUILD) -b singlehtml -c util/bikeshed \
$(ALLSPHINXOPTS) $(BUILDDIR)/bikeshed_singlehtml
python util/bikeshed_fixup.py $(BUILDDIR)/bikeshed_singlehtml/index.html \
>$(BUILDDIR)/bikeshed_singlehtml/index_fixed.html
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
bikeshed spec index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
mkdir -p $(BUILDDIR)/html/bikeshed/
Expand All @@ -148,9 +153,48 @@ bikeshed:
cp -r util/katex/dist/* $(BUILDDIR)/html/bikeshed/katex/dist/
patch -p0 $(BUILDDIR)/html/bikeshed/katex/dist/katex.css \
< util/katex_fix.patch
cp $(BUILDDIR)/bikeshed_singlehtml/_static/pygments.css \
$(BUILDDIR)/html/bikeshed/
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/."

.PHONY: WD-tar
WD-tar: bikeshed
@echo "Building tar file..."
tar cvf \
$(BUILDDIR)/WD.tar \
--transform='s|$(BUILDDIR)/html/bikeshed/||' \
--transform='s|index.html|Overview.html|' \
$(BUILDDIR)/html/bikeshed/index.html \
$(BUILDDIR)/html/bikeshed/pygments.css \
$(BUILDDIR)/html/bikeshed/katex/dist/katex.css \
$(BUILDDIR)/html/bikeshed/katex/dist/fonts
@echo "Built $(BUILDDIR)/WD.tar."

.PHONY: WD-echidna
WD-echidna: WD-tar
@if [ -z $(W3C_USERNAME) ] || \
[ -z $(W3C_PASSWORD) ] || \
[ -z $(DECISION_URL) ] ; then \
echo "Must provide W3C_USERNAME, W3C_PASSWORD, and DECISION_URL environment variables"; \
exit 1; \
fi
curl 'https://labs.w3.org/echidna/api/request' \
--user '$(W3C_USERNAME):$(W3C_PASSWORD)' \
-F "tar=@$(BUILDDIR)/WD.tar" \
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
@echo
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

.PHONY: diff
diff: bikeshed
@echo "Downloading the old single-file html spec..."
curl `grep "^TR" index.bs | cut -d' ' -f2` -o $(BUILDDIR)/html/bikeshed/old.html
@echo "Done."
@echo "Diffing new against old (go get a coffee)..."
perl ../util/htmldiff.pl $(BUILDDIR)/html/bikeshed/old.html $(BUILDDIR)/html/bikeshed/index.html $(BUILDDIR)/html/bikeshed/diff.html
@echo "Done. The diff is at $(BUILDDIR)/html/bikeshed/diff.html"

.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
Expand Down
8 changes: 3 additions & 5 deletions document/core/appendix/algorithm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ The control stack is likewise manipulated through auxiliary functions:
func push_ctrl(opcode : opcode, in : list(val_type), out : list(val_type)) =
 let frame = ctrl_frame(opcode, in, out, opds.size(), false)
  ctrls.push(frame)
push_opds(in)
func pop_ctrl() : ctrl_frame =
 error_if(ctrls.is_empty())
 let frame = ctrls.pop()
 let frame = ctrls[0]
  pop_opds(frame.end_types)
  error_if(opds.size() =/= frame.height)
ctrls.pop()
  return frame
func label_types(frame : ctrl_frame) : list(val_types) =
Expand Down Expand Up @@ -167,18 +169,15 @@ Other instructions are checked in a similar manner.
case (block t1*->t2*)
pop_opds([t1*])
push_ctrl(block, [t1*], [t2*])
push_opds([t1*])
case (loop t1*->t2*)
pop_opds([t1*])
push_ctrl(loop, [t1*], [t2*])
push_opds([t1*])
case (if t1*->t2*)
pop_opd(I32)
pop_opds([t1*])
push_ctrl(if, [t1*], [t2*])
push_opds([t1*])
case (end)
let frame = pop_ctrl()
Expand All @@ -188,7 +187,6 @@ Other instructions are checked in a similar manner.
let frame = pop_ctrl()
error_if(frame.opcode =/= if)
push_ctrl(else, frame.start_types, frame.end_types)
push_opds(frame.start_types)
case (br n)
     error_if(ctrls.size() < n)
Expand Down
2 changes: 1 addition & 1 deletion document/core/appendix/custom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Currently, only one dedicated custom section is defined, the :ref:`name section<
Name Section
~~~~~~~~~~~~

The *name section* is a :ref:`custom sections <binary-customsec>` whose name string is itself :math:`\text{name}`.
The *name section* is a :ref:`custom section <binary-customsec>` whose name string is itself :math:`\text{name}`.
The name section should appear only once in a module, and only after the :ref:`data section <binary-datasec>`.

The purpose of this section is to attach printable names to definitions in a module, which e.g. can be used by a debugger or when parts of the module are to be rendered in :ref:`text form <text>`.
Expand Down
10 changes: 5 additions & 5 deletions document/core/appendix/embedding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Modules

2. Let :math:`\export^\ast` be the :ref:`exports <syntax-export>` :math:`\module.\MEXPORTS`.

3. Assert: the length of :math:`\export^\ast` equals the length of :math:`\externtype^\ast`.
3. Assert: the length of :math:`\export^\ast` equals the length of :math:`{\externtype'}^\ast`.

4. For each :math:`\export_i` in :math:`\export^\ast` and corresponding :math:`\externtype'_i` in :math:`{\externtype'}^\ast`, do:

Expand Down Expand Up @@ -335,7 +335,7 @@ Tables

3. Let :math:`\X{ti}` be the :ref:`table instance <syntax-tableinst>` :math:`\store.\STABLES[\tableaddr]`.

4. If :math:`i` is larger than or equal to the length if :math:`\X{ti}.\TIELEM`, then return :math:`\ERROR`.
4. If :math:`i` is larger than or equal to the length of :math:`\X{ti}.\TIELEM`, then return :math:`\ERROR`.

5. Else, return :math:`\X{ti}.\TIELEM[i]`.

Expand All @@ -357,7 +357,7 @@ Tables

3. Let :math:`\X{ti}` be the :ref:`table instance <syntax-tableinst>` :math:`\store.\STABLES[\tableaddr]`.

4. If :math:`i` is larger than or equal to the length if :math:`\X{ti}.\TIELEM`, then return :math:`\ERROR`.
4. If :math:`i` is larger than or equal to the length of :math:`\X{ti}.\TIELEM`, then return :math:`\ERROR`.

5. Replace :math:`\X{ti}.\TIELEM[i]` with the optional :ref:`function address <syntax-funcaddr>` :math:`\X{fa}^?`.

Expand Down Expand Up @@ -461,7 +461,7 @@ Memories

3. Let :math:`\X{mi}` be the :ref:`memory instance <syntax-meminst>` :math:`\store.\SMEMS[\memaddr]`.

4. If :math:`i` is larger than or equal to the length if :math:`\X{mi}.\MIDATA`, then return :math:`\ERROR`.
4. If :math:`i` is larger than or equal to the length of :math:`\X{mi}.\MIDATA`, then return :math:`\ERROR`.

5. Else, return the :ref:`byte <syntax-byte>` :math:`\X{mi}.\MIDATA[i]`.

Expand All @@ -483,7 +483,7 @@ Memories

3. Let :math:`\X{mi}` be the :ref:`memory instance <syntax-meminst>` :math:`\store.\SMEMS[\memaddr]`.

4. If :math:`i` is larger than or equal to the length if :math:`\X{mi}.\MIDATA`, then return :math:`\ERROR`.
4. If :math:`i` is larger than or equal to the length of :math:`\X{mi}.\MIDATA`, then return :math:`\ERROR`.

5. Replace :math:`\X{mi}.\MIDATA[i]` with :math:`\byte`.

Expand Down
Loading

0 comments on commit 983320a

Please sign in to comment.