- 24 Feb, 2017 1 commit
-
-
Damien George authored
This patch allows uPy consts to be bignums, eg: X = const(1 << 100) The infrastructure for consts to be a bignum (rather than restricted to small integers) has been in place for a while, ever since constant folding was upgraded to allow bignums. It just required a small change (in this patch) to enable it.
-
- 22 Feb, 2017 9 commits
-
-
Damien George authored
-
Damien George authored
socket.timeout is a subclass of OSError, and using the latter is more efficient than having a dedicated class. The argument of OSError is ETIMEDOUT so the error can be distinguished from other kinds of OSErrors. This follows how the esp8266 port does it.
-
Damien George authored
Some compilers can't analyse the code to determine that these variables are always set before being used.
-
Damien George authored
Since we recently replaced the OSError string messages with simple error codes, having the uerrno module gets back some user friendly error messages. The total code size (after removing strings, replacing with uerrno module) is decreased.
-
Damien George authored
It's configurable by defining MICROPY_PY_UERRNO_LIST. If this is not defined then a default is provided.
-
Damien George authored
It's configured by MICROPY_PY_UERRNO_ERRORCODE and enabled by default (since that's the behaviour before this patch). Without this dict the lookup of errno codes to strings must use the uerrno module itself.
-
Damien George authored
-
Damien George authored
-
Damien George authored
It saves about 400 bytes of code space because the functions can now be inlined.
-
- 21 Feb, 2017 9 commits
-
-
Damien George authored
-
Damien George authored
Fixes issues #2880 and #2881.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
Most of cc3200 uses explicit simplelink calls anyway, and this means there are no longer any clashes with macros from the C stdlib.
-
Damien George authored
ftp.c is the only user of this function so making it static in that file allows it to be inlined. Also, reusing unichar_toupper means we no longer depend on the C stdlib for toupper, saving about 300 bytes of code space.
-
- 20 Feb, 2017 6 commits
-
-
Damien George authored
-
Rami Ali authored
-
Rami Ali authored
This patch introduces the a small framework to track differences between uPy and CPython. The framework consists of: - A set of "tests" which test for an individual feature that differs between uPy and CPy. Each test is like a normal uPy test in the test suite, but has a special comment at the start with some meta-data: a category (eg syntax, core language), a human-readable description of the difference, a cause, and a workaround. Following the meta-data there is a short code snippet which demonstrates the difference. See tests/cpydiff directory for the initial set of tests. - A program (this patch) which runs all the tests (on uPy and CPy) and generates nicely-formated .rst documenting the differences. - Integration into the docs build so that everything is automatic, and the differences appear in a way that is easy for users to read/reference (see latter commits). The idea with using this new framework is: - When a new difference is found it's easy to write a short test for it, along with a description, and add it to the existing ones. It's also easy for contributors to submit tests for differences they find. - When something is no longer different the tool will give an error and difference can be removed (or promoted to a proper feature test).
-
Rami Ali authored
These tests are intended to fail, as they provide a programatic record of differences between uPy and CPython. They also contain a special comment at the start of the file which has meta-data describing the difference, including known causes and known workarounds.
-
Damien George authored
Before this patch, assigning anything other than a list would lead to a crash. Fixes issue #2886.
-
Paul Sokolovsky authored
-
- 17 Feb, 2017 13 commits
-
-
Paul Sokolovsky authored
But leave a generic warning that users should be aware of Zephyr's limitations/issues for a board they use.
-
Damien George authored
-
Stephan Brauer authored
-
stijn authored
Since VS2015 update 2 .db files are used for storing browsing info, instead of .sdf files. If users don't specify a location for these files excplicitly they end up in the project directory so ignore them.
-
Damien George authored
-
Damien George authored
-
Damien George authored
Since the recent changes to string/bytes literal concatenation, this rule is no longer used.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
It's much more efficient in RAM and code size to do implicit literal string concatenation in the lexer, as opposed to the compiler. RAM usage is reduced because the concatenation can be done right away in the tokeniser by just accumulating the string/bytes literals into the lexer's vstr. Prior to this patch adjacent strings/bytes would create a parse tree (one node per string/bytes) and then in the compiler a whole new chunk of memory was allocated to store the concatenated string, which used more than double the memory compared to just accumulating in the lexer. This patch also significantly reduces code size: bare-arm: -204 minimal: -204 unix x64: -328 stmhal: -208 esp8266: -284 cc3200: -224
-
Damien George authored
Previous to this patch there was an explicit check for errors with line continuation (where backslash was not immediately followed by a newline). But this check is not necessary: if there is an error then the remaining logic of the tokeniser will reject the backslash and correctly produce a syntax error.
-
Damien George authored
Since the table of keywords is sorted, we can use strcmp to do the search and stop part way through the search if the comparison is less-than. Because all tokens that are names are subject to this search, this optimisation will improve the overall speed of the lexer when processing a script. The change also decreases code size by a little bit because we now use strcmp instead of the custom str_strn_equal function.
-
- 16 Feb, 2017 2 commits
-
-
Damien George authored
Keywords only needs to be searched for if the token is a MP_TOKEN_NAME, so we can move the seach to the part of the code that does the tokenising for MP_TOKEN_NAME.
-
Damien George authored
-