Commit message (Collapse) | Author | Age | |
---|---|---|---|
* | objstr: Remove code duplication and unbreak Windows build. | Paul Sokolovsky | 2015-01-23 |
| | | | | | | | | There was really weird warning (promoted to error) when building Windows port. Exact cause is still unknown, but it uncovered another issue: 8-bit and unicode str_make_new implementations should be mutually exclusive, and not built at the same time. What we had is that bytes_decode() pulled 8-bit str_make_new() even for unicode build. | ||
* | objstr*: Use separate names for locals_dict of 8-bit and unicode str's. | Paul Sokolovsky | 2015-01-23 |
| | | | | To somewhat unbreak -DSTATIC="" compile. | ||
* | py: Add comments for vstr_init and mp_obj_new_str. | Damien George | 2015-01-21 |
| | |||
* | py: Remove mp_obj_str_builder and use vstr instead. | Damien George | 2015-01-21 |
| | | | | | | | | | | | | With this patch str/bytes construction is streamlined. Always use a vstr to build a str/bytes object. If the size is known beforehand then use vstr_init_len to allocate only required memory. Otherwise use vstr_init and the vstr will grow as needed. Then use mp_obj_new_str_from_vstr to create a str/bytes object using the vstr memory. Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes on unix x64. | ||
* | py: Add mp_obj_new_str_from_vstr, and use it where relevant. | Damien George | 2015-01-21 |
| | | | | | | | | This patch allows to reuse vstr memory when creating str/bytes object. This improves memory usage. Also saves code ROM: 128 bytes on stmhal, 92 bytes on bare-arm, and 88 bytes on unix x64. | ||
* | py, unix: Allow to compile with -Wunused-parameter. | Damien George | 2015-01-20 |
| | | | | See issue #699. | ||
* | py, unix, stmhal: Allow to compile with -Wshadow. | Damien George | 2015-01-20 |
| | | | | See issue #699. | ||
* | py, unix: Allow to compile with -Wsign-compare. | Damien George | 2015-01-16 |
| | | | | See issue #699. | ||
* | py, unix: Allow to compile with -Wdouble-promotion. | Damien George | 2015-01-12 |
| | | | | Ref issue #699. | ||
* | py: Remove unnecessary BINARY_OP_EQUAL code that just checks pointers. | Damien George | 2015-01-11 |
| | | | | | | | Previous patch c38dc3ccc76d1a9bf867704f43ea5d15da3fea7b allowed any object to be compared with any other, using pointer comparison for a fallback. As such, existing code which checked for this case is no longer needed. | ||
* | objstr: Common subexpression elimination for vstr_str(field_name). | Paul Sokolovsky | 2015-01-04 |
| | |||
* | objstr: Implement kwargs support for str.format(). | Paul Sokolovsky | 2015-01-04 |
| | |||
* | py: Move to guarded includes, everywhere in py/ core. | Damien George | 2015-01-01 |
| | | | | Addresses issue #1022. | ||
* | objstr: Fix %d-formatting of floats. | Paul Sokolovsky | 2014-12-31 |
| | |||
* | py: Make bytes objs work with more str methods; add tests. | Damien George | 2014-12-24 |
| | |||
* | py: Use str_to_int function in more places to reduce code size. | Damien George | 2014-12-21 |
| | |||
* | py: Fix function type: () -> (void). | Damien George | 2014-12-10 |
| | |||
* | py: Allow bytes/bytearray/array to be init'd by buffer protocol objects. | Damien George | 2014-12-04 |
| | | | | | | | Behaviour of array initialisation is subtly different for bytes, bytearray and array.array when argument has buffer protocol. This patch gets us CPython conformant (except we allow initialisation of array.array by buffer with length not a multiple of typecode). | ||
* | py: #if guard str_make_new when not needed. | Damien George | 2014-11-27 |
| | |||
* | py: Use shorter, static error msgs when ERROR_REPORTING_TERSE enabled. | Damien George | 2014-11-06 |
| | | | | | | | | Going from MICROPY_ERROR_REPORTING_NORMAL to MICROPY_ERROR_REPORTING_TERSE now saves 2020 bytes ROM for ARM Thumb2, and 2200 bytes ROM for 32-bit x86. This is about a 2.5% code size reduction for bare-arm. | ||
* | py: Allow bytes object as argument to some str methods. | Damien George | 2014-11-05 |
| | | | | | | This turns failing assertions to type exceptions for things like b"123".find(...). We still don't support operations like this on bytes objects (unlike CPython), but at least it no longer crashes. | ||
* | py: Allow +, in, and compare ops between bytes and bytearray/array. | Damien George | 2014-11-05 |
| | | | | | | Eg b"123" + bytearray(2) now works. This patch actually decreases code size while adding functionality: 32-bit unix down by 128 bytes, stmhal down by 84 bytes. | ||
* | objstr: Allow to convert any buffer proto object to str. | Paul Sokolovsky | 2014-10-31 |
| | | | | | Original motivation is to support converting bytearrays, but easier to just support buffer protocol at all. | ||
* | py: mp_obj_str_get_str(): Work with bytes too. | Paul Sokolovsky | 2014-10-31 |
| | | | | | | | It should be fair to say that almost in all cases where some API call expects string, it should be also possible to pass byte string. For example, it should be open/delete/rename file with name as bytestring. Note that similar change was done quite a long ago to mp_obj_str_get_data(). | ||
* | py: Use MP_OBJ_NULL instead of NULL in a few places. | Damien George | 2014-10-23 |
| | |||
* | py: Make mp_const_empty_bytes globally available. | Damien George | 2014-10-21 |
| | |||
* | py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places. | Damien George | 2014-10-03 |
| | | | | This should pretty much resolve issue #50. | ||
* | py: Simplify JSON str printing (while still conforming to JSON spec). | Damien George | 2014-09-25 |
| | | | | | The JSON specs are relatively flexible and allow us to use one function to print strings, be they ascii, bytes or utf-8 encoded. | ||
* | py: Add native json printing using existing print framework. | Damien George | 2014-09-17 |
| | | | | | Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both. | ||
* | py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, working towards resolving issue #50. | ||
* | py: Remove use of int type in obj.h. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, working towards resolving issue #50. | ||
* | py: Change all uint to mp_uint_t in obj.h. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, working towards resolving issue #50. | ||
* | py: Make tuple and list use mp_int_t/mp_uint_t. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, to resolve issue #50. | ||
* | Change some parts of the core API to use mp_uint_t instead of uint/int. | Damien George | 2014-08-30 |
| | | | | Addressing issue #50, still some way to go yet. | ||
* | py: Use memmove instead of memcpy when appropriate. | Damien George | 2014-08-29 |
| | | | | | Found this bug by running unix/ tests with DEBUG=1 enabled when compiling. | ||
* | py: Improve efficiency of MP_OBJ_IS_STR_OR_BYTES. | Damien George | 2014-08-27 |
| | | | | | Saves ROM (16 on stmhal, 240 on 64-bit unix) and should be quicker since there is 1 less branch. | ||
* | Make int(b'123') work properly. | Dave Hylands | 2014-08-26 |
| | |||
* | py: Fix mult by negative number of tuple, list, str, bytes. | Damien George | 2014-08-13 |
| | | | | | | | Multiplication of a tuple, list, str or bytes now yields an empty sequence (instead of crashing). Addresses issue #799 Also added ability to mult bytes on LHS by integer. | ||
* | py, objstr: Optimise bytes subscr when unicode is enabled. | Damien George | 2014-08-11 |
| | | | | Saves code bytes and makes it faster, so why not? | ||
* | objstr: Make sure that bytes are indexed as bytes, not as unicode. | Paul Sokolovsky | 2014-08-11 |
| | | | | Fixes #795. | ||
* | objstr: split(): check arg type consistency (str vs bytes). | Paul Sokolovsky | 2014-08-10 |
| | | | | Similar to other methods and following CPython3 strictness. | ||
* | py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself. | Damien George | 2014-07-31 |
| | | | | Addresses issue #724. | ||
* | py: Add mp_obj_str_builder_end_with_len. | Damien George | 2014-07-31 |
| | | | | | This allows to create str's with a smaller length than initially asked for. | ||
* | Rename machine_(u)int_t to mp_(u)int_t. | Damien George | 2014-07-03 |
| | | | | See discussion in issue #50. | ||
* | py: Make unichar_charlen() accept/return machine_uint_t. | Paul Sokolovsky | 2014-06-28 |
| | |||
* | py: Small comments, name changes, use of machine_int_t. | Damien George | 2014-06-28 |
| | |||
* | objstrunicode: Refactor str_index_to_ptr() following objstr. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstr: 64-bit issues. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstr: find(), rfind(), index(): Make return value be unicode-aware. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstrunicode: Re-add buffer protocol back for now, required for io.StringIO. | Paul Sokolovsky | 2014-06-27 |
| |