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

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Mar 26, 2020
2 parents d7f0241 + bcb6a41 commit b4637e9
Show file tree
Hide file tree
Showing 45 changed files with 3,072 additions and 2,873 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: c++
language: python
python:
- "2.7"
- "3.7"

sudo: on

Expand Down
2 changes: 1 addition & 1 deletion document/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NEWMATHJAX = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

Expand Down
2 changes: 1 addition & 1 deletion document/core/binary/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Their contents consist of a :ref:`name <syntax-name>` further identifying the cu
\end{array}
.. note::
If an implementation interprets the contents of a custom section, then errors in that contents, or the placement of the section, must not invalidate the module.
If an implementation interprets the data of a custom section, then errors in that data, or the placement of the section, must not invalidate the module.


.. index:: ! type section, type definition
Expand Down
10 changes: 6 additions & 4 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,15 @@ Memory Instructions

8. Pop the value :math:`\I32.\CONST~n` from the stack.

9. Either, try :ref:`growing <grow-mem>` :math:`\X{mem}` by :math:`n` :ref:`pages <page-size>`:
9. Let :math:`\X{err}` be the |i32| value :math:`2^{32}-1`, for which :math:`\signed_{32}(\X{err})` is :math:`-1`.

10. Either, try :ref:`growing <grow-mem>` :math:`\X{mem}` by :math:`n` :ref:`pages <page-size>`:

a. If it succeeds, push the value :math:`\I32.\CONST~\X{sz}` to the stack.

b. Else, push the value :math:`\I32.\CONST~(-1)` to the stack.
b. Else, push the value :math:`\I32.\CONST~\X{err}` to the stack.

10. Or, push the value :math:`\I32.\CONST~(-1)` to the stack.
11. Or, push the value :math:`\I32.\CONST~\X{err}` to the stack.

.. math::
~\\[-1ex]
Expand All @@ -613,7 +615,7 @@ Memory Instructions
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
S; F; (\I32.\CONST~n)~\MEMORYGROW &\stepto& S; F; (\I32.\CONST~{-1})
S; F; (\I32.\CONST~n)~\MEMORYGROW &\stepto& S; F; (\I32.\CONST~\signed_{32}^{-1}(-1))
\end{array}
\end{array}
Expand Down
2 changes: 1 addition & 1 deletion document/core/exec/runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ That way, the end of the inner instruction sequence is known when part of an out
When |END| is reached, i.e., the inner instruction sequence has been reduced to the empty sequence -- or rather, a sequence of :math:`n` |CONST| instructions representing the resulting values -- then the |LABEL| instruction is eliminated courtesy of its own :ref:`reduction rule <exec-label>`:

.. math::
\LABEL_n\{\instr^n\}~\val^\ast~\END \quad\stepto\quad \val^n
\LABEL_m\{\instr^\ast\}~\val^n~\END \quad\stepto\quad \val^n
This can be interpreted as removing the label from the stack and only leaving the locally accumulated operand values.

Expand Down
8 changes: 4 additions & 4 deletions document/core/text/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,13 @@ The syntax for exports mirrors their :ref:`abstract syntax <syntax-export>` dire
\text{(}~\text{export}~~\X{nm}{:}\Tname~~d{:}\Texportdesc_I~\text{)}
&\Rightarrow& \{ \ENAME~\X{nm}, \EDESC~d \} \\
\production{export description} & \Texportdesc_I &::=&
\text{(}~\text{func}~~x{:}\Bfuncidx_I~\text{)}
\text{(}~\text{func}~~x{:}\Tfuncidx_I~\text{)}
&\Rightarrow& \EDFUNC~x \\ &&|&
\text{(}~\text{table}~~x{:}\Btableidx_I~\text{)}
\text{(}~\text{table}~~x{:}\Ttableidx_I~\text{)}
&\Rightarrow& \EDTABLE~x \\ &&|&
\text{(}~\text{memory}~~x{:}\Bmemidx_I~\text{)}
\text{(}~\text{memory}~~x{:}\Tmemidx_I~\text{)}
&\Rightarrow& \EDMEM~x \\ &&|&
\text{(}~\text{global}~~x{:}\Bglobalidx_I~\text{)}
\text{(}~\text{global}~~x{:}\Tglobalidx_I~\text{)}
&\Rightarrow& \EDGLOBAL~x \\
\end{array}
Expand Down
2 changes: 1 addition & 1 deletion document/core/util/bikeshed_fixup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- coding: latin-1 -*-

import os
Expand Down
2 changes: 2 additions & 0 deletions document/core/util/mathdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ def run(self):

def setup(app):
app.add_node(math,
override = True,
html = (ext_html_visit_math, None),
latex = (ext_latex_visit_math, None))
app.add_node(displaymath,
override = True,
html = (ext_html_visit_displaymath, None),
latex = (ext_latex_visit_displaymath, None))
app.add_role('math', ext_math_role)
Expand Down
12 changes: 6 additions & 6 deletions document/core/util/mathjax2katex.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- coding: latin-1 -*-

import Queue
import queue
import os
import re
import shelve
Expand Down Expand Up @@ -84,7 +84,7 @@ def ReplaceMath(cache, data):
data = re.sub('([^\\\\])[$]', '\\1', data)
data = '\\mathrm{' + data + '}'

if cache.has_key(data):
if data in cache:
return cache[data]

macros = {}
Expand All @@ -99,15 +99,15 @@ def ReplaceMath(cache, data):
value = parts[name_end+len('#1'):end]
macros[name] = value
data = data[:start] + data[end:]
for k, v in macros.iteritems():
for k, v in macros.items():
while True:
start, end = FindMatching(data, k + '{')
if start is None:
break
data = data[:start] + v.replace('#1', data[start+len(k):end]) + data[end:]
p = subprocess.Popen(
['node', os.path.join(SCRIPT_DIR, 'katex/cli.js'), '--display-mode'],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
ret = p.communicate(input=data)[0]
if p.returncode != 0:
sys.stderr.write('BEFORE:\n' + old + '\n')
Expand Down Expand Up @@ -239,7 +239,7 @@ def Worker():
q.task_done()
sys.stderr.write('.')

q = Queue.Queue()
q = queue.Queue()
for i in range(40):
t = threading.Thread(target=Worker)
t.daemon = True
Expand Down
Loading

0 comments on commit b4637e9

Please sign in to comment.