summaryrefslogtreecommitdiffstatshomepage
path: root/unix-cpy
Commit message (Collapse)AuthorAge
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* py: Add MICROPY_COMP_{DOUBLE,TRIPLE}_TUPLE_ASSIGN config options.Damien George2015-03-14
| | | | | | These allow to fine-tune the compiler to select whether it optimises tuple assignments of the form a, b = c, d and a, b, c = d, e, f. Sensible defaults are provided.
* unix-cpy: Fix compiler warning about unused variable.Damien George2015-02-07
|
* py: Protect mp_parse and mp_compile with nlr push/pop block.Damien George2015-02-07
| | | | | | | | | | 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.
* unix-cpy: Prefix includes with py/; remove need for -I../py.Damien George2015-01-01
|
* py: Move to guarded includes, everywhere in py/ core.Damien George2015-01-01
| | | | Addresses issue #1022.
* Makefiles: Support py/*.h includes per #1022.Paul Sokolovsky2014-12-27
|
* modsys: Add sys.print_exception(exc, file=sys.stdout) function.Paul Sokolovsky2014-12-08
| | | | | | | | | | | | The function is modeled after traceback.print_exception(), but unbloated, and put into existing module to save overhead on adding another module. Compliant traceback.print_exception() is intended to be implemented in micropython-lib in terms of sys.print_exception(). This change required refactoring mp_obj_print_exception() to take pfenv_t interface arguments. Addresses #751.
* unix-cpy: Fix build due to change in lexer API.Damien George2014-12-05
|
* ports: Define mp_off_t.Paul Sokolovsky2014-11-17
|
* Add -Wpointer-arith flag to prevent problems with pointer arithmetic on void*stijn2014-10-29
|
* py: Make compiler return a proper exception on SyntaxError.Damien George2014-10-05
|
* Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George2014-08-04
| | | | | | | qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* Provide definition of alloca() in mpconfigport.h.Damien George2014-06-08
|
* Rename configuration variables controling Python features.Damien George2014-05-24
| | | | Now of the form MICROPY_PY_*. See issue #35.
* Tidy up some configuration options.Damien George2014-05-21
| | | | | | | | | | MP_ALLOC_* -> MICROPY_ALLOC_* MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX MICROPY_EXTRA_* -> MICROPY_PORT_* See issue #35.
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* unix-cpy: Put mpconfig.h before all other headers.Damien George2014-05-02
|
* build: Simplify build directory layout by putting all headers in genhdr.Damien George2014-04-17
| | | | | Any generated headers go in $(BUILD)/genhdr/, and are #included as 'genhdr/xxx.h'.
* build directory can now be renamedAndrew Scheller2014-04-16
| | | | | | | | | The autogenerated header files have been moved about, and an extra include dir has been added, which means you can give a custom BUILD=newbuilddir option to make, and everything "just works" Also tidied up the way the different Makefiles build their include- directory flags
* bare-arm/unix-cpy: Minor changes.Damien George2014-04-13
|
* Add a check for NULL nlr_top in nlr_jump.Damien George2014-04-08
| | | | | | If no nlr_buf has been pushed, and an nlr_jump is called, then control is transferred to nlr_jump_fail (which should bail out with a fatal error).
* unix-cpy: Pass emit opt to mp_compile.Damien George2014-04-06
|
* py: Add "io" module.Paul Sokolovsky2014-04-03
| | | | | | So far just includes "open" function, which should be supplied by a port. TODO: Make the module #ifdef'ed.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
* py: Factor out code from runtime.c to emitglue.c.Damien George2014-03-27
|
* unix-cpy: Switch to use MICROPY_FLOAT_IMPL config define.Paul Sokolovsky2014-03-16
|
* Implement proper exception type hierarchy.Damien George2014-02-15
| | | | | | | | | | | | | | Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
* Add mp_import_stat to unix-cpy port.Damien George2014-02-06
|
* Change -Og to -O0 in unix-cpy/Makefile; cast to small int in socket.c.Damien George2014-01-26
|
* Rework makefiles. Add proper dependency checking.Dave Hylands2014-01-24
|
* Second stage of qstr revamp: uPy str object can be qstr or not.Damien George2014-01-22
|
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
| | | | | Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
* py: Add module/function/class name to exceptions.Damien George2014-01-19
| | | | | | | Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
* Add source file name and line number to error messages.Damien George2014-01-18
| | | | | Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
* Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2intDamien George2014-01-15
|\ | | | | | | | | | | | | Conflicts: py/objint.c unix-cpy/Makefile unix/Makefile
| * Implemented int(str) in UNIXxyb2014-01-14
| |
* | Convert parse errors to exceptions.Damien George2014-01-15
| | | | | | | | | | Parser no longer prints an error, but instead returns an exception ID and message.
* | made DEBUG control CFLAGS in Makefiles oter than stm as well.John R. Lenton2014-01-13
|/
* Make build output quieter.Dave Hylands2014-01-08
| | | | | | Use make V=1e make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. This should fix issue #117
* Factor and simplify Makefile's and mpconfig, part 2.Damien George2014-01-07
|
* Factor and simplify Makefile's and mpconfig.Damien George2014-01-07
|
* Convert Python types to proper Python type hierarchy.Damien George2014-01-04
| | | | Now much more inline with how CPython does types.
* Add basic implementation of slice object.Paul Sokolovsky2014-01-04
| | | | | So far, only start and stop integer indexes are supported. Step is not supported, as well as objects of arbitrary types.
* Move INT_FMT, etc. declaration into global mpconfig.h .Paul Sokolovsky2014-01-04
| | | | This in particular makes it available for stm port.
* unix-cpy: Fix mpconfig to work with new scheme.Damien George2014-01-03
|
* Change mp_compile so that it returns a function object for the module.Damien George2014-01-03
|
* Basic implementation of import.Damien George2014-01-03
| | | | | | import works for simple cases. Still work to do on finding the right script, and setting globals/locals correctly when running an imported function.
* Add module object, to be used eventually for import.Damien George2014-01-02
|