summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2015-09-15py/objslice: Fix indent.Tom Soulanille
2015-09-15py/objslice: Make slice attributes (start/stop/step) readable.Tom Soulanille
Configurable with MICROPY_PY_BUILTINS_SLICE_ATTRS. Disabled by default.
2015-09-15py/mpz: Fix calculation of max digit storage for mpz; fix sys.maxsize.Damien George
When creating constant mpz's, the length of the mpz must be exactly how many digits are used (not allocated) otherwise these numbers are not compatible with dynamically allocated numbers. Addresses issue #1448.
2015-09-12lib/mp-readline: Add auto-indent support.Damien George
4 spaces are added at start of line to match previous indent, and if previous line ended in colon. Backspace deletes 4 space if only spaces begin a line. Configurable via MICROPY_REPL_AUTO_INDENT. Disabled by default.
2015-09-11stmhal: fix single precision float printing errorDave Hylands
Fixes #1435.
2015-09-07py/lexer: Properly classify floats that look like hex numbers.Damien George
Eg 0e0 almost looks like a hex number but in fact is a float.
2015-09-07py/lexer: Raise SyntaxError when unicode char point out of range.Damien George
2015-09-07py/lexer: Raise NotImplError for unicode name escape, instead of assert.Damien George
2015-09-07py/compile: Refine SyntaxError for repeated use of global/nonlocal.Damien George
2015-09-04py: Eliminate some cases which trigger unused parameter warnings.Damien George
2015-09-04py/objstr: Check for keyword args before checking for no posn args.Damien George
Otherwise something like bytes(abc=123) will succeed.
2015-09-04py/objstr: For str.endswith(s, start) raise NotImpl instead of assert.Damien George
2015-09-04py/objbool: Simplify dispatch of bool binary op.Damien George
This optimises (in speed and code size) for the common case where the binary op for the bool object is supported. Unsupported binary ops still behave the same.
2015-09-04py/compile: Only compile function annotations if really needed.Damien George
Function annotations are only needed when the native emitter is enabled and when the current scope is emitted in viper mode. All other times the annotations can be skipped completely.
2015-09-03stmhal: add option to query for the current usb modeTony Abboud
Fetch the current usb mode and return a string representation when pyb.usb_mode() is called with no args. The possible string values are interned as qstr's. None will be returned if an incorrect mode is set.
2015-09-03py: Use mp_not_implemented consistently for not implemented features.Damien George
2015-09-03py/objstr: Simplify printing of bytes objects when unicode enabled.Damien George
2015-09-03py: Inline single use of mp_obj_str_get_len in mp_obj_len_maybe.Damien George
Gets rid of redundant double check for string type. Also remove obsolete declaration of mp_obj_str_get_hash.
2015-09-03py: Make "enumerate" qstr be conditional on MICROPY_PY_BUILTINS_ENUMERATE.Paul Sokolovsky
2015-09-01py/binary: Add support for array('q') and array('Q').Damien George
2015-09-01py/objstr: Make str.rsplit(None,n) raise NotImpl instead of assert(0).Damien George
2015-09-01vm: Handle "raise X from Y" statements the best way we can.Paul Sokolovsky
By issuing a warning that exception chaining is not supported, and ignoring "from Y" argument.
2015-08-31modbuiltins: Consistently use indentation for #if.Paul Sokolovsky
2015-08-30py/objstr: Simplify error handling for bad conversion specifier.Damien George
2015-08-30py/objgetitemiter: Make it_iternext() recognize IndexError.Tom Soulanille
2015-08-29py/objstr: Fix error reporting for unexpected end of modulo format str.Damien George
2015-08-29py/objstr: Fix error type for badly formatted format specifier.Damien George
Was KeyError, should be ValueError.
2015-08-29py/objstr: Make string formatting 8-bit clean.Damien George
2015-08-29py: Treat -m32 flag as part of CC, LD, etc.Paul Sokolovsky
Indeed, this flag efectively selects architecture target, and must consistently apply to all compiles and links, including 3rd-party libraries, unlike CFLAGS, which have MicroPython-specific setting.
2015-08-28objset: frozensets are hashable.Paul Sokolovsky
2015-08-20py: Add MICROPY_PY_BUILTINS_FILTER, disable for minimal ports.Paul Sokolovsky
Saves 320 bytes on x86.
2015-08-17py: Remove unused compile scope flags, and irrelevant flag compute code.Damien George
2015-08-17unix-cpy: Remove unix-cpy. It's no longer needed.Damien George
unix-cpy was originally written to get semantic equivalent with CPython without writing functional tests. When writing the initial implementation of uPy it was a long way between lexer and functional tests, so the half-way test was to make sure that the bytecode was correct. The idea was that if the uPy bytecode matched CPython 1-1 then uPy would be proper Python if the bytecodes acted correctly. And having matching bytecode meant that it was less likely to miss some deep subtlety in the Python semantics that would require an architectural change later on. But that is all history and it no longer makes sense to retain the ability to output CPython bytecode, because: 1. It outputs CPython 3.3 compatible bytecode. CPython's bytecode changes from version to version, and seems to have changed quite a bit in 3.5. There's no point in changing the bytecode output to match CPython anymore. 2. uPy and CPy do different optimisations to the bytecode which makes it harder to match. 3. The bytecode tests are not run. They were never part of Travis and are not run locally anymore. 4. The EMIT_CPYTHON option needs a lot of extra source code which adds heaps of noise, especially in compile.c. 5. Now that there is an extensive test suite (which tests functionality) there is no need to match the bytecode. Some very subtle behaviour is tested with the test suite and passing these tests is a much better way to stay Python-language compliant, rather than trying to match CPy bytecode.
2015-08-13py: Add stream_tell method, and use for unix and stmhal file tell.blmorris
2015-08-12py: In native ARM emitter, load r7 with table earlier in func prelude.Damien George
r7 may be needed to set up code state, so it must be loaded before the set-up function is called.
2015-08-12py/makeversionhdr.py: Use returncode attr to be Python2.7 compat.Damien George
2015-08-11py/makeversionhdr.py: Fallback to using docs version if no git repo.Damien George
Addresses issue #1420.
2015-08-02py/objlist: Make list += accept all arguments and add test.Damien George
2015-07-31makeqstrdata.py: Typo fix in comment.Paul Sokolovsky
2015-07-29py/compile: Give more precise line number for compile errors.Damien George
Previous to this patch there were some cases where line numbers for errors were 0 (unknown). Now the compiler attempts to give a better line number where possible, in some cases giving the line number of the closest statement, and other cases the line number of the inner-most scope of the error (eg the line number of the start of the function). This helps to give good (and sometimes exact) line numbers for ViperTypeError exceptions. This patch also makes sure that the first compile error (eg SyntaxError) that is encountered is reported (previously it was the last one that was reported).
2015-07-29py/repl: Don't look inside strings for unmatched brackets/quotes.Damien George
When looking to see if the REPL input needs to be continued on the next line, don't look inside strings for unmatched ()[]{} ''' or """. Addresses issue #1387.
2015-07-27py: For viper compile errors, add traceback with function and filename.Damien George
ViperTypeError now includes filename and function name where the error occurred. The line number is the line number of the start of the function definition, which is the best that can be done without a lot more work. Partially addresses issue #1381.
2015-07-26py: Disable REPL EMACS key bindings by default.Damien George
2015-07-26lib/mp-readline: Add emacs-style control characters for cursor movement.Tom Soulanille
Disabled by default. Adds 108 bytes to Thumb2 arch when enabled.
2015-07-24py/parse: Fix handling of empty input so it raises an exception.Damien George
2015-07-24py/parse: De-duplicate and simplify code for parser "or" rule.Damien George
2015-07-23py/lexer: Raise SyntaxError when str hex escape sequence is malformed.Damien George
Addresses issue #1390.
2015-07-23py: Issue an error when compiling Viper functions with more than 4 args.Damien George
Otherwise it can be very hard to track down bugs.
2015-07-23py: Allow viper functions to take up to 4 arguments.Damien George
Addresses issue #1380.
2015-06-06py: reduce array slice assignment code sizeDelio Brignoli