summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2016-04-15py: Declare help, input, open builtins in core.Paul Sokolovsky
These are *defined* per-port, but why redeclare them again and again.
2016-04-14py/makeqstrdata: Add special case to handle \n qstr.Damien George
2016-04-14py/makeqstrdata: Reinstate Python2 compatibility.Damien George
2016-04-14py/makeqstrdata: Fix rendering of qstrs that have non-printable ASCII.Damien George
The qstr data needs to be turned into a proper C string so non-ASCII chars must be properly escaped according to C rules.
2016-04-14py: Simplify "and" action within parser by making ident-rules explicit.Damien George
Most grammar rules can optimise to the identity if they only have a single argument, saving a lot of RAM building the parse tree. Previous to this patch, whether a given grammar rule could be optimised was defined (mostly implicitly) by a complicated set of logic rules. With this patch the definition is always specified explicitly by using "and_ident" in the rule definition in the grammar. This simplifies the logic of the parser, making it a bit smaller and faster. RAM usage in unaffected.
2016-04-13py/makeqstrdata: Add more names for escaped chars and esc non-printable.Damien George
Non-printable characters are escaped as 0xXX, where XX are the hex digits of the character value.
2016-04-13py: Add ability to have frozen persistent bytecode from .mpy files.Damien George
The config variable MICROPY_MODULE_FROZEN is now made of two separate parts: MICROPY_MODULE_FROZEN_STR and MICROPY_MODULE_FROZEN_MPY. This allows to have none, either or both of frozen strings and frozen mpy files (aka frozen bytecode).
2016-04-13py/makeqstrdata: Factor out some code to functions that can be reused.Damien George
2016-04-13py/emitglue: Make mp_raw_code_t* arguments constant pointers.Damien George
2016-04-13py/emitglue: Move typedef of mp_raw_code_t from .c to .h file.Damien George
It's needed by frozen bytecode.
2016-04-13py: Fix constant folding and inline-asm to work with new async grammar.Damien George
2016-04-13py: add async/await/async for/async with syntaxpohmelie
They are sugar for marking function as generator, "yield from" and pep492 python "semantically equivalents" respectively. @dpgeorge was the original author of this patch, but @pohmelie made changes to implement `async for` and `async with`.
2016-04-13py/modbuiltins: __repl_print__: Add comment about setting "_" special var.Paul Sokolovsky
2016-04-12extmod/machine_i2c: Implement I2C memory reading/writing.Damien George
2016-04-12extmod: Add generic machine.I2C class, with bit-bang I2C.Damien George
Should work on any machine that provides the correct pin functions.
2016-04-12extmod: Add initial framebuf module.Damien George
2016-04-10py/stream: Move uPy func obj wrappers to below their respective funcs.Damien George
2016-04-10py/stream: Simplify arg extraction logic for stream_ioctl.Damien George
Saves 16 bytes of code. Also, use mp_obj_get_int_truncated to allow integers as big as a machine word to be passed as the value.
2016-04-10py/stream: ioctl(): Properly support 2-arg form.Paul Sokolovsky
2016-04-10py/stream: Fix signed comparison issue.Paul Sokolovsky
2016-04-10py/stream: Add Python-level ioctl() method.Paul Sokolovsky
Will call underlying C virtual methods of stream interface. This isn't intended to be added to every stream object (it's not in CPython), but is convenient way to expose extra operation on Python side without adding bunch of Python-level methods.
2016-04-10py/stream.h: Add bigger inventory of stream ioctl's.Paul Sokolovsky
2016-04-07py/objarray: Fix array.append so it doesn't extend if append fails.Damien George
Addresses issue #1965.
2016-04-07py: Implement basic with support in native emitter.Damien George
2016-04-07py: Combine continuous block of emit steps into with_cleanup emit call.Damien George
Because different emitters need to handle with-cleanup in different ways.
2016-04-05py: Move stream-related declarations from obj.h to stream.h.Paul Sokolovsky
2016-04-04py/obj.h: Add comment why mp_fun_kw_t takes non-const mp_map_t*.Paul Sokolovsky
mp_fun_kw_t takes mp_map_t* (and not const mp_map_t*) to ease passing this arg to mp_map_lookup(), which may modify its arg, depending on flags.
2016-04-01py/map: Prevent map resize failure from destroying map.Stephen Kyle
2016-03-30py/ringbuf.h: Add reusable ring buffer class.Paul Sokolovsky
Features inline get/put operations for the highest performance. Locking is not part of implementation, operation should be wrapped with locking externally as needed.
2016-03-29py/parsenum: Use pow function to apply exponent to decimal number.Damien George
Pow is already a dependency when compiling with floats, so may as well use it here to reduce code size and speed up the conversion for most cases.
2016-03-29py/formatfloat: Fix further cases of buffer overflow in formatting.Damien George
Includes extensive test cases to catch hopefully all cases where buffer might overflow.
2016-03-29py/formatfloat: Fix case of float format where leading digit was "10".Damien George
When taking the logarithm of the float to determine the exponent, there are some edge cases that finish the log loop too large. Eg for an input value of 1e32-epsilon, this is actually less than 1e32 from the log-loop table and finishes as 10.0e31 when it should be 1.0e32. It is thus rendered as :e32 (: comes after 9 in ascii). There was the same problem with numbers less than 1.
2016-03-27py/stream: Fix stupid thinko with variable naming/shadowing.Paul Sokolovsky
2016-03-25extmod/modlwip: Add SOL_SOCKET and SO_REUSEADDR constants for setsockopt().Paul Sokolovsky
2016-03-25py/modio: io.BufferedWriter: Describe flushing policy.Paul Sokolovsky
2016-03-25py/modio: Implement io.BufferedWriter.flush().Paul Sokolovsky
2016-03-25py/modio: Initial implementation of io.BufferedWriter class.Paul Sokolovsky
Just .write() method implemented currently.
2016-03-24py/stream: Fix object vs ptr usecase in mp_stream_writeall().Paul Sokolovsky
2016-03-24extmod/modwebsocket: Start module for WebSocket helper functions.Paul Sokolovsky
Currently, only write support is implemented (of limited buffer size).
2016-03-24py/stream: Add mp_stream_writeall() helper function.Paul Sokolovsky
Spools entire output buffer to a blocking stream (chunk by chunk if needed).
2016-03-19py/parse: When looking up consts, check they exist before checking type.Damien George
2016-03-16py: Don't allocate an extra parse node for power exponent.Damien George
Previous to this patch, the "**b" in "a**b" had its own parse node with just one item (the "b"). Now, the "b" is just the last element of the power parse-node. This saves (a tiny bit of) RAM when compiling.
2016-03-16py/frozenmod: Allow port to override lexer to use for frozen modules.Paul Sokolovsky
2016-03-16py/objfun: Allow inline-asm functions to be called with 4 arguments.Damien George
2016-03-15py/formatfloat: Fix buffer overflow when formatting tiny numbers.Damien George
2016-03-15py: For mp_buffer_info_t, change len type from mp_uint_t to size_t.Damien George
2016-03-14py/objarray: Fix array slice assignment when array is reallocated.Damien George
Addresses issue #1898.
2016-03-14py/parsenum: Fix compiler warnings for no decl and signed comparison.Damien George
2016-03-14py: When printf'ing an object as a pointer, pass the concrete pointer.Damien George
2016-03-14py: Fix passing of some wide int types to printf varg format list.Damien George
Passing an mp_uint_t to a %d printf format is incorrect for builds where mp_uint_t is larger than word size (eg a nanboxing build). This patch adds some simple casting to int in these cases.