<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/parse.c, branch v1.4.5</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.5</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.5'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-07-24T15:05:56+00:00</updated>
<entry>
<title>py/parse: Fix handling of empty input so it raises an exception.</title>
<updated>2015-07-24T15:05:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-07-24T15:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96f0dd3cbc404b7f96bd7a35247faea8da266638'/>
<id>urn:sha1:96f0dd3cbc404b7f96bd7a35247faea8da266638</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/parse: De-duplicate and simplify code for parser "or" rule.</title>
<updated>2015-07-24T14:35:57+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-07-24T14:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=fa7c61dfab0822619451673d726a5b444d3a9d28'/>
<id>urn:sha1:fa7c61dfab0822619451673d726a5b444d3a9d28</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Improve allocation policy of qstr data.</title>
<updated>2015-07-14T21:56:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-13T20:53:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ade9a052365247be5ed4ce8b53c2164a576a4a05'/>
<id>urn:sha1:ade9a052365247be5ed4ce8b53c2164a576a4a05</id>
<content type='text'>
Previous to this patch all interned strings lived in their own malloc'd
chunk.  On average this wastes N/2 bytes per interned string, where N is
the number-of-bytes for a quanta of the memory allocator (16 bytes on 32
bit archs).

With this patch interned strings are concatenated into the same malloc'd
chunk when possible.  Such chunks are enlarged inplace when possible,
and shrunk to fit when a new chunk is needed.

RAM savings with this patch are highly varied, but should always show an
improvement (unless only 3 or 4 strings are interned).  New version
typically uses about 70% of previous memory for the qstr data, and can
lead to savings of around 10% of total memory footprint of a running
script.

Costs about 120 bytes code size on Thumb2 archs (depends on how many
calls to gc_realloc are made).
</content>
</entry>
<entry>
<title>py: Clean up some bits and pieces in parser, grammar.</title>
<updated>2015-04-21T16:43:18+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-21T16:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4735c45c511bf29ecb422456ca2ab0437e3c4ef0'/>
<id>urn:sha1:4735c45c511bf29ecb422456ca2ab0437e3c4ef0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Update parse.c&amp;mpconfig.h to reflect rename of mp_lexer_show_token.</title>
<updated>2015-02-23T21:36:05+00:00</updated>
<author>
<name>nhtshot</name>
<email>nhtshot@gmail.com</email>
</author>
<published>2015-02-23T21:05:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5d323defe4dab940494002e80c69cfb36d204a49'/>
<id>urn:sha1:5d323defe4dab940494002e80c69cfb36d204a49</id>
<content type='text'>
This function is only used when DEBUG_PRINTERS and USE_RULE_NAME are
enabled.
</content>
</entry>
<entry>
<title>py: Expose compile.c:list_get as mp_parse_node_extract_list.</title>
<updated>2015-02-13T02:29:46+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-13T02:29:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dfe944c3e5c2a7fa04c3416266728ffce6332bf8'/>
<id>urn:sha1:dfe944c3e5c2a7fa04c3416266728ffce6332bf8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Initialise variables in mp_parse correctly, to satisfy gcc warning.</title>
<updated>2015-02-08T13:40:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-08T13:40:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f804833a97c75882653e655ee95722c4cb7ae218'/>
<id>urn:sha1:f804833a97c75882653e655ee95722c4cb7ae218</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Parse big-int/float/imag constants directly in parser.</title>
<updated>2015-02-08T01:57:40+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-08T01:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d414a1b52d193bab2c94cf56932e1eba23ba542'/>
<id>urn:sha1:7d414a1b52d193bab2c94cf56932e1eba23ba542</id>
<content type='text'>
Previous to this patch, a big-int, float or imag constant was interned
(made into a qstr) and then parsed at runtime to create an object each
time it was needed.  This is wasteful in RAM and not efficient.  Now,
these constants are parsed straight away in the parser and turned into
objects.  This allows constants with large numbers of digits (so
addresses issue #1103) and takes us a step closer to #722.
</content>
</entry>
<entry>
<title>py: Protect mp_parse and mp_compile with nlr push/pop block.</title>
<updated>2015-02-07T18:33:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-07T18:33:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0bfc7638baa4c5a4a2351364ab770a188dcab302'/>
<id>urn:sha1:0bfc7638baa4c5a4a2351364ab770a188dcab302</id>
<content type='text'>
To enable parsing constants more efficiently, mp_parse should be allowed
to raise an exception, and mp_compile can already raise a MemoryError.
So these functions need to be protected by an nlr push/pop block.

This patch adds that feature in all places.  This allows to simplify how
mp_parse and mp_compile are called: they now raise an exception if they
have an error and so explicit checking is not needed anymore.
</content>
</entry>
<entry>
<title>py: Be more machine-portable with size of bit fields.</title>
<updated>2015-01-24T23:12:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-24T23:12:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5c670acb1fdd04dcb9c220fee7cbeeb6b0c440e5'/>
<id>urn:sha1:5c670acb1fdd04dcb9c220fee7cbeeb6b0c440e5</id>
<content type='text'>
</content>
</entry>
</feed>
