<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/compile.c, branch 2.x</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.x</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.x'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-08-21T12:00:34+00:00</updated>
<entry>
<title>py/compile: Remove unused pn_colon code when compiling func params.</title>
<updated>2017-08-21T12:00:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-08-21T12:00:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ad6aae13a4f633cb95d6e6149d839448e4702c2a'/>
<id>urn:sha1:ad6aae13a4f633cb95d6e6149d839448e4702c2a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py/compile: Fix enum variable declaration.</title>
<updated>2017-07-09T03:18:14+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-07-09T03:18:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0291a624cbb0fc12633291b5b53285f7425dd3dc'/>
<id>urn:sha1:0291a624cbb0fc12633291b5b53285f7425dd3dc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/compile: Use switch-case to match token and operator.</title>
<updated>2017-07-05T05:50:36+00:00</updated>
<author>
<name>Krzysztof Blazewicz</name>
<email>blazewicz.krzysztof@gmail.com</email>
</author>
<published>2017-04-27T19:33:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=91a385db98711c2a9115ad661cb4d637450d7ee2'/>
<id>urn:sha1:91a385db98711c2a9115ad661cb4d637450d7ee2</id>
<content type='text'>
Reduces code size.
</content>
</entry>
<entry>
<title>py/compile: Combine arith and bit-shift ops into 1 compile routine.</title>
<updated>2017-07-05T05:49:00+00:00</updated>
<author>
<name>Krzysztof Blazewicz</name>
<email>blazewicz.krzysztof@gmail.com</email>
</author>
<published>2017-04-27T19:32:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a040fb89e7b8507aa775b0620de1770642b0f5ee'/>
<id>urn:sha1:a040fb89e7b8507aa775b0620de1770642b0f5ee</id>
<content type='text'>
This refactoring saves code space.
</content>
</entry>
<entry>
<title>py/compile: Optimise emitter label indices to save a word of heap.</title>
<updated>2017-06-22T05:05:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-06-22T05:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d94bc675e8f3bcf37acf2d88d7c0ce0d9de68672'/>
<id>urn:sha1:d94bc675e8f3bcf37acf2d88d7c0ce0d9de68672</id>
<content type='text'>
Previous to this patch, a label with value "0" was used to indicate an
invalid label, but that meant a wasted word (at slot 0) in the array of
label offsets.  This patch adjusts the label indices so the first one
starts at 0, and the maximum value indicates an invalid label.
</content>
</entry>
<entry>
<title>py/compile: Fix bug with break/continue in else of optimised for-range.</title>
<updated>2017-06-22T03:50:33+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-06-22T03:50:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4c5f108321a8fd3f67f597ca918427eda813c12e'/>
<id>urn:sha1:4c5f108321a8fd3f67f597ca918427eda813c12e</id>
<content type='text'>
This patch fixes a bug whereby the Python stack was not correctly reset if
there was a break/continue statement in the else black of an optimised
for-range loop.

For example, in the following code the "j" variable from the inner for loop
was not being popped off the Python stack:

    for i in range(4):
        for j in range(4):
            pass
        else:
            continue

This is now fixed with this patch.
</content>
</entry>
<entry>
<title>py/compile: Raise SyntaxError if positional args are given after */**.</title>
<updated>2017-06-14T08:18:01+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-06-14T08:18:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1e70fda69fcb4991eb60ed43e610f664ea1319e6'/>
<id>urn:sha1:1e70fda69fcb4991eb60ed43e610f664ea1319e6</id>
<content type='text'>
In CPython 3.4 this raises a SyntaxError.  In CPython 3.5+ having a
positional after * is allowed but uPy has the wrong semantics and passes
the arguments in the incorrect order.  To prevent incorrect use of a
function going unnoticed it is important to raise the SyntaxError in uPy,
until the behaviour is fixed to follow CPython 3.5+.
</content>
</entry>
<entry>
<title>various: Spelling fixes</title>
<updated>2017-05-29T08:36:05+00:00</updated>
<author>
<name>Ville Skyttä</name>
<email>ville.skytta@iki.fi</email>
</author>
<published>2017-05-29T07:08:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ca16c3821053e5bf2b87aeb10007f73f31dc1eac'/>
<id>urn:sha1:ca16c3821053e5bf2b87aeb10007f73f31dc1eac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls.</title>
<updated>2017-04-22T13:39:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-18T23:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dd11af209d226b7d18d5148b239662e30ed60bad'/>
<id>urn:sha1:dd11af209d226b7d18d5148b239662e30ed60bad</id>
<content type='text'>
This patch allows the following code to run without allocating on the heap:

    super().foo(...)

Before this patch such a call would allocate a super object on the heap and
then load the foo method and call it right away.  The super object is only
needed to perform the lookup of the method and not needed after that.  This
patch makes an optimisation to allocate the super object on the C stack and
discard it right after use.

Changes in code size due to this patch are:

   bare-arm: +128
    minimal: +232
   unix x64: +416
unix nanbox: +364
     stmhal: +184
    esp8266: +340
     cc3200: +128
</content>
</entry>
</feed>
