Krzysztof Blazewicz
7feb7301b2
tests/basics: Add tests for arithmetic operators precedence.
8 years ago
Krzysztof Blazewicz
91a385db98
py/compile: Use switch-case to match token and operator.
Reduces code size.
8 years ago
Krzysztof Blazewicz
a040fb89e7
py/compile: Combine arith and bit-shift ops into 1 compile routine.
This refactoring saves code space.
8 years ago
Damien George
f110dbd795
extmod/modujson: Properly initialise temporary StringIO object.
7 years ago
Damien George
e66fd56852
py/repl: Change mp_uint_t to size_t in repl helpers.
7 years ago
Damien George
7bd10c1ffe
py: Change mp_uint_t to size_t in builtins code.
7 years ago
Damien George
8b84b8ab8a
py/objdict: Factorise dict accessor helper to reduce code size.
Code size change in bytes for this patch is:
bare-arm: -72
minimal x86: -48
unix x64: -32
unix nanbox: -120
stmhal: -68
cc3200: -64
esp8266: -56
7 years ago
Damien George
d5ec46ace4
stmhal/boards/NUCLEO_F429ZI: Change USB config from HS to FS peripheral.
This dev board only has a single USB connector, connected to the FS
peripheral.
7 years ago
Damien George
b51919f5b7
py/makeversionhdr.py: Update to parse new release line in docs/conf.py.
The line in docs/conf.py with the release/version number was recently
changed and this patch makes the makeversionhdr.py script work again.
7 years ago
Damien George
48b745cfc8
esp8266/mpconfigport_512k: Use terse error messages to get 512k to fit.
7 years ago
Paul Sokolovsky
503cf3d097
docs/uzlib: Update description of decompress() and mention DecompIO.
7 years ago
Damien George
6b8b56f859
py/modmath: Check for zero division in log with 2 args.
7 years ago
Damien George
9ed5e80eea
py/vm: Make "if" control flow more obvious in YIELD_FROM opcode.
7 years ago
Damien George
9d2c72ad4f
py/objstr: Remove unnecessary "sign" variable in formatting code.
7 years ago
Damien George
2138258fea
py/runtime: Mark m_malloc_fail() as NORETURN.
7 years ago
Damien George
9aeba3e41b
py/binary: Add missing "break" statements.
7 years ago
Damien George
80b31dc097
stmhal: Clean up some header includes.
7 years ago
Alberto Petrucci
5b509dbc7b
stmhal/boards: Add configuration files for NUCLEO_F429ZI.
7 years ago
Damien George
3c62577ee9
docs/pyboard: Move info about using Windows from topindex to general.
7 years ago
Damien George
b86c65d31c
extmod/modubinascii: Add check for empty buffer passed to hexlify.
Previous to this patch hexlify(b'', b':') would lead to a bad crash due to
the computed length of the result being -1=0xffffffff.
7 years ago
Patrick O'Leary
45b127e7ac
docs/esp8266/general.rst: Fix name of NTP module.
The simple NTP client module is named "ntptime.py".
7 years ago
Paul Sokolovsky
ffb13cc633
docs/uerrno: Document "uerrno" module.
7 years ago
Paul Sokolovsky
4f23c5d587
docs/pyboard: Move hardware info into General Info chapter.
This makes top-level ToC of the pyboard docs consistent with other ports
(consisting of 3 chapters: QuickRef, General Info, and Tutorial).
Also, some other minor tweaks applied, like local ToC for General Info and
headings mentioning pyboard.
7 years ago
Paul Sokolovsky
e467949a4a
docs/*_index: Drop "Indices and tables" pseudo-section.
This pseudo-section causes artifacts with latexpdf generation (almost
empty page with list containing literal "genindex", "modeindex", "search"
items). For HTML docs, these sections can be accessed from "home" page.
7 years ago
Damien George
65417c5ad9
py/objstr: Move uPy function wrappers to just after the C function.
This matches the coding/layout style of all the other objects.
7 years ago
Paul Sokolovsky
90c1d54464
docs/conf.py: Set "version" and "release" to the same value.
We don't use alpha/beta/RC, so for us version and release should be the
same, or it leads to confusion (for example, current, 1.9.1 docs are
marked as 1.9 at places).
7 years ago
Paul Sokolovsky
a6af1a1d9c
docs/replace.inc: Add |see_cpython|, to xref individual symbols from CPython.
The idea is to use it for each symbol in builtins.rst.
7 years ago
Paul Sokolovsky
465d84b7e7
docs/library: Add CPython docs xref to each pertinent module.
Cross-reference text/link is implemented as RST substitution, so easy to
consistently.
7 years ago
Paul Sokolovsky
ebce7984c6
docs/conf.py: Add file for global replacements definition.
The idea is to allow to define a kind of "macros" for repeatitive text,
so all occurrances can be updated in one place. Unfortunately, RST doesn't
support replacements with arguments, which limits usefulness of them and
should be taken into account.
7 years ago
Paul Sokolovsky
5f0c56bcf1
docs/conf.py: Switch to "new" format of intersphinx_mapping.
As described at
http://www.sphinx-doc.org/en/stable/ext/intersphinx.html#confval-intersphinx_mapping
This will allow to explicitly refer to CPython docs for cross-references.
7 years ago
Damien George
7e14f99c26
docs/topindex.html: Fix typo in "Glossary" heading.
7 years ago
Paul Sokolovsky
d0797fbc18
docs: Add glossary.
We have enough terms or references throughout the docs which may be not
immediately clear or have some important nuances. Referencing terms in
gloassary is the best way to deal with that.
7 years ago
Paul Sokolovsky
d80ecad03f
docs/ure: Elaborate doc, update markup to the latest conventions.
7 years ago
Paul Sokolovsky
d42bb58c33
docs/builtins: Add AssertionError, SyntaxError, ZeroDivisionError.
Also, update heading of 1st sections to "Functions and types".
7 years ago
Paul Sokolovsky
8b7d311595
reference/index: Rewrite introduction paragraph to avoid confusion.
The old intro talked about "differences", but there were hardly any
sections describing differences, mostly MicroPython specific features.
On the other hand, we now have real "differences" chapter, though it's
mostly concerned with stdlib differences.
So, try to avoid confusion by changing wording and linking to the other
chapters and contrasting them with what is described in "MicroPython
language".
7 years ago
Paul Sokolovsky
50eea26145
docs/differences/index_template: Use consistent heading casing.
And in our case, "consistent" is where each word in the heading is *not*
capitalized.
7 years ago
Damien George
f585526c80
docs: Move topindex.html to templates/ subdir.
Later versions of jinja2 need it to be in this subdir, and earlier versions
work with it here as well.
7 years ago
Paul Sokolovsky
ef47dee4bf
docs/conf.py: Add .venv dir to exclude_patterns.
It's useful to try different Sphinx versions using virtualenv/venv, so
exclude a common venv dir name from Sphinx processing.
7 years ago
Paul Sokolovsky
e334b6b6d2
docs/constrained: Use markup adhering to the latest docs conventions.
7 years ago
Paul Sokolovsky
58b7b01cb5
extmod/modure: If input string is bytes, return bytes results too.
This applies to match.group() and split().
For ARM Thumb2, this increased code size by 12 bytes.
7 years ago
Paul Sokolovsky
871a45dd0c
docs/{uselect,ussl,ustruct}: Use markup adhering to latest docs conventions.
7 years ago
Damien George
f2babeaeda
docs/topindex.html: Remove link to wipy.io, it's no longer available.
7 years ago
Damien George
369e7fd178
tests/unix/extra_coverage: Add test for mp_vprintf with bad fmt spec.
7 years ago
Damien George
adf22c19ae
py/mpprint: Remove unreachable check for neg return of mp_format_float.
7 years ago
Damien George
8f6ef8de48
tests/basics/namedtuple1: Add test for creating with pos and kw args.
7 years ago
Damien George
265500c5c8
py/objnamedtuple: Simplify and remove use of alloca building namedtuple.
Prior to this patch there were 2 paths for creating the namedtuple, one for
when no keyword args were passed, and one when there were keyword args.
And alloca was used in the keyword-arg path to temporarily create the array
of elements for the namedtuple, which would then be copied to a
heap-allocated object (the namedtuple itself).
This patch simplifies the code by combining the no-keyword and keyword
paths, and removing the need for the alloca by constructing the namedtuple
on the heap before populating it.
Heap usage in unchanged, stack usage is reduced, use of alloca is removed,
and code size is not increased and is actually reduced by between 20-30
bytes for most ports.
7 years ago
Paul Sokolovsky
1942f0ceef
docs/{framebuf,usocket}: Use markup adhering to the latest docs conventions.
7 years ago
Damien George
346f5d4cce
stmhal/mpconfigport.h: Allow MICROPY_PY_THREAD to be overridden.
7 years ago
Damien George
05a08506ae
stmhal/Makefile: Add CFLAGS_EXTRA to CFLAGS so cmdline can add options.
7 years ago
Damien George
703370ebc5
stmhal/Makefile: Rename FLOAT_IMPL to MICROPY_FLOAT_IMPL to match C name
The name used in py/mpconfig.h is MICROPY_FLOAT_IMPL so rename this
Makefile variable to mirror that.
7 years ago