314 Commits (de5a9d72dcdaacdd5048195cd5bab007f4b2baef)

Author SHA1 Message Date
Delio Brignoli e6978a4e26 py: Fix call args when a stararg is followed by keyword args.
7 years ago
Damien George 558a016e2c py/compile: Refine SyntaxError for repeated use of global/nonlocal.
8 years ago
Damien George ea5b59bfe6 py/compile: Only compile function annotations if really needed.
8 years ago
Damien George 7f70b60f4d py: Remove unused compile scope flags, and irrelevant flag compute code.
8 years ago
Damien George 65dc960e3b unix-cpy: Remove unix-cpy. It's no longer needed.
8 years ago
Damien George cfc4c33801 py/compile: Give more precise line number for compile errors.
8 years ago
Damien George 84d59c2873 py: For viper compile errors, add traceback with function and filename.
8 years ago
Damien George 59fba2d6ea py: Remove mp_load_const_bytes and instead load precreated bytes object.
8 years ago
Damien George c8b60f013b py: Make viper codegen raise proper exception (ViperTypeError) on error.
8 years ago
Damien George 55fe92bb8f py: Remove old debugging printf's in compile.c.
8 years ago
Damien George 91bc32dc16 py: Provide typedefs for function types instead of writing them inline.
8 years ago
Damien George 4dea922610 py: Adjust some spaces in code style/format, purely for consistency.
8 years ago
Damien George 4112590a60 py, compiler: When just bytecode, make explicit calls instead of table.
8 years ago
Damien George a210c774f9 py, compiler: Remove emit_pass1 code, using emit_bc to do its job.
8 years ago
Damien George 542bd6b4a1 py, compiler: Refactor load/store/delete_id logic to reduce code size.
8 years ago
Damien George 44f65c0e2f py: Fix bug in compiler which allowed through illegal augmented assign.
8 years ago
Damien George aedf583af2 py: Simplify some logic in compiler; add comments about CPython compat.
8 years ago
Damien George 1ef26b35c1 py, extmod: Remove include of unnecessary system headers.
8 years ago
Damien George 42e0c59308 py: Add MICROPY_COMP_{DOUBLE,TRIPLE}_TUPLE_ASSIGN config options.
8 years ago
Damien George a77ffe66b2 py: In compiler, put macro guard around potentially unused asm vars.
8 years ago
Damien George 3665d0b2ff py: Simplify some inline-assembler error messages, but retain meaning.
8 years ago
Damien George 9c5cabb502 py: Give error for duplicate label in inline assembler.
8 years ago
Damien George 62a3a287d9 py: Set compiler scope before folding constants so error messages work.
8 years ago
Damien George 7711afbb4a py: Combine complie functions for or_test/and_test to reduce code size.
8 years ago
Damien George 63f3832e81 py: Combine emit functions for jump true/false to reduce code size.
8 years ago
Damien George 0b2fd91890 py: Combine logic for compiling and/or tests, to reduce code size.
8 years ago
Damien George 0bb971370b py: Transform assert logic in compiler to save code space.
8 years ago
Damien George 3d7bf5d4b1 py: More robust checking in inline assembler compiler.
8 years ago
Damien George dfe944c3e5 py: Expose compile.c:list_get as mp_parse_node_extract_list.
8 years ago
Damien George 8dfbd2d589 py: Make inline assembler raise proper SyntaxError exception on error.
8 years ago
Damien George 7d414a1b52 py: Parse big-int/float/imag constants directly in parser.
8 years ago
Damien George 0bfc7638ba py: Protect mp_parse and mp_compile with nlr push/pop block.
8 years ago
Damien George 0d3cb6726d py: Change vstr so that it doesn't null terminate buffer by default.
8 years ago
Damien George 05005f679e py: Remove mp_obj_str_builder and use vstr instead.
8 years ago
Damien George ff8dd3f486 py, unix: Allow to compile with -Wunused-parameter.
8 years ago
Damien George 50912e7f5d py, unix, stmhal: Allow to compile with -Wshadow.
8 years ago
Damien George 963a5a3e82 py, unix: Allow to compile with -Wsign-compare.
8 years ago
Damien George 0abb5609b0 py: Remove unnecessary id_flags argument from emitter's load_fast.
8 years ago
Damien George d2d64f00fb py: Add "default" to switches to allow better code flow analysis.
8 years ago
Damien George 65ef6b768c py: Only allocate strings/bytes once for load_const_obj.
8 years ago
Damien George 1e1779eacf py: Reluctantly add an extra pass to bytecode compiler.
8 years ago
Damien George c935d69f74 py: Make compiler not crash when default except is not last.
8 years ago
Damien George 4c81ba8015 py: Never intern data of large string/bytes object; add relevant tests.
8 years ago
Damien George ddd1e18801 py: Add config option MICROPY_COMP_MODULE_CONST for module consts.
8 years ago
Damien George 51dfcb4bb7 py: Move to guarded includes, everywhere in py/ core.
8 years ago
Damien George 83204f3406 py: Allow to properly disable builtin slice operation.
8 years ago
Damien George e37dcaafb4 py: Allow to properly disable builtin "set" object.
8 years ago
Damien George 01039b5bd8 py: Remove last uses of printf from compile; use proper SyntaxError.
8 years ago
Damien George 584ba6762f py: Move global/nonlocal decl code to compiler for proper SyntaxError.
8 years ago
Damien George 6efa66f125 py: Remove unnecessary RULE_none and PN_none from parser.
8 years ago
Damien George e181c0dc07 py: Fix optimised for-loop compiler so it follows proper semantics.
8 years ago
Damien George c33ce606cf py: Fix a semantic issue with range optimisation.
8 years ago
Damien George 969a6b37bf py: Make functions static where appropriate.
8 years ago
Paul Sokolovsky 039887a0ac py: Fix bug with right-shifting small ints by large amounts.
8 years ago
Damien George 391db8669b py: Add more compiler optimisations for constant if/while conditions.
8 years ago
Damien George 235f9b33c8 py: Simplify compilation of elif blocks.
8 years ago
Damien George 090c9236e8 py: Fix compiling of nested while/for and exception handler.
8 years ago
Damien George a91ac2011f py: Make compiler return a proper exception on SyntaxError.
8 years ago
Damien George 00be7a849a py: Fix unix-cpy to compile with uint->mp_uint_t changes.
8 years ago
Damien George 39dc145478 py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places.
8 years ago
Damien George 42f3de924b py: Convert [u]int to mp_[u]int_t where appropriate.
8 years ago
Damien George 52b5d76a6b py: Free non-interned strings in the parser when not needed.
9 years ago
Damien George 7ff996c237 py: Convert [u]int to mp_[u]int_t in emit.h and associated .c files.
9 years ago
Damien George c90f59ec3a py: Add support for emitting native x86 machine code.
9 years ago
Damien George dda46460ff Code style/whitespace cleanup; remove obsolete headers.
9 years ago
Damien George eb4e18f057 py: Add compiler optimisation for conditions in parenthesis.
9 years ago
Fabian Vogt fe3d16e8c2 Basic native ARM emitter
9 years ago
Damien George a5190a7dac py: Fix typing of viper locals; allow default types in annotation.
9 years ago
Damien George 2ac4af6946 py: Allow viper to have type annotations.
9 years ago
Damien George 6be0b0a8ec py: Clean up and simplify functions in scope; add STATIC in compiler.
9 years ago
Paul Sokolovsky 8215847b4d moductypes: Foreign data interface module, roughly based on ctype ideas.
9 years ago
Damien George 40f3c02682 Rename machine_(u)int_t to mp_(u)int_t.
9 years ago
Damien George b601d9574a py: Improvements to native emitter.
9 years ago
Paul Sokolovsky 59c675a64c py: Include mpconfig.h before all other includes.
9 years ago
Emmanuel Blot f6932d6506 Prefix ARRAY_SIZE with micropython prefix MP_
9 years ago
Damien George f0778a7ccb py: Implement default keyword only args.
9 years ago
Damien George 5b5562c1d1 py: Fix stack underflow with optimised for loop.
9 years ago
Damien George 25c84643b6 py: Fix break from within a for loop.
9 years ago
Damien George d1e355ea8e py: Fix check of small-int overflow when parsing ints.
9 years ago
Damien George 5042bce8fb py: Don't automatically intern strings in parser.
9 years ago
Damien George 58ebde4664 Tidy up some configuration options.
9 years ago
Damien George 96f137b24a py: Rename BYTE_CODE to BYTECODE (this was missed in previous rename).
9 years ago
Damien George 3417bc2f25 py: Rename byte_code to bytecode everywhere.
9 years ago
Damien George ffae48d750 py, compiler: Add basic support for A=const(123).
9 years ago
Damien George 36db6bcf54 py, compiler: Improve passes; add an extra pass for native emitter.
9 years ago
Damien George ca25c15d56 py, compiler: Start adding support for compile-time constants.
9 years ago
Damien George 04b9147e15 Add license header to (almost) all files.
9 years ago
Damien George 708c073250 py: Add '*' qstr for 'import *'; use blank qstr for comprehension arg.
9 years ago
Damien George 968bf34c4c py: Remove unnecessary LOAD_CONST_ID bytecode.
9 years ago
Damien George 9d181f62dc py: Save some ROM by shortening compiler error messages.
9 years ago
Damien George 2c0842b3c5 py: Change the way function arguments are compiled.
9 years ago
Damien George 2827d62e8b py: Implement keyword-only args.
9 years ago
Damien George 6d3c5e4301 Add ARRAY_SIZE macro, and use it where possible.
9 years ago
Damien George 1463c1fa82 py: Add MICROPY_ENABLE_DOC_STRING, disabled by default.
9 years ago
Damien George e5f8a77db6 py: Add 'align' and 'data' meta-instructions to inline assembler.
9 years ago
Damien George 3558f62fb5 py: Making closures now passes pointer to stack, not a tuple for vars.
9 years ago
Damien George 729f7b42d6 py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
9 years ago
Damien George df8127a17e py: Remove unique_codes from emitglue.c. Replace with pointers.
9 years ago
Damien George a26dc50968 py: Improve inline assembler; improve compiler constant folding.
9 years ago
Damien George 7b4330191f py, compiler: Fix up creation of default positionals tuple.
9 years ago
Damien George 8b19db00aa py, compiler: Fix compiling of keyword args following named star.
9 years ago
Damien George 69b89d21b2 py: Change compile order for default positional and keyword args.
9 years ago
Damien George 0e3329a6b8 py, compiler: Allow lambda's to yield.
9 years ago
Damien George 0288cf020e py: Implement compiling of *-expr within parenthesis.
9 years ago
Damien George 57e99ebc86 py: Add simple way of looking up constants in compiler.
9 years ago
Damien George d66ae18640 py: Simplify stack get/set to become stack adjust in emitters.
9 years ago
Damien George 069a35e3a5 py, compiler: Improve stack depth counting.
9 years ago
Damien George 6f355fd3b9 py: Make labels unsigned ints (converted from int).
9 years ago
Damien George 635543c72c py, compiler: Implement compiling of relative imports.
9 years ago
Damien George 2bf7c09222 py: Properly implement deletion of locals and derefs, and detect errors.
9 years ago
Damien George 11d8cd54c9 py, compiler: Turn id_info_t.param into a set of flags.
9 years ago
Damien George b140bff877 py, compile: Simplify initialisation of compiler structure.
9 years ago
Damien George 02a4c05c5f py, compile: Reduce size of compiler structure.
9 years ago
Damien George 922ddd6415 py, compile: Combine have_star_arg, have_dbl_star_arg into star_flags.
9 years ago
Damien George 78035b995f py, compiler: Clean up and compress scope/compile structures.
9 years ago
Damien George 495d781a36 py: implement UNPACK_EX byte code (for: a, *b, c = d)
9 years ago
Damien George b7ffdcc1c7 py: Improve compiler syntax errors; catch more errors.
9 years ago
Damien George cdd96dff2c py: Implement more features in native emitter.
9 years ago
Damien George 65cad12d38 py: Add option to compiler to specify default code emitter.
9 years ago
Damien George af27259439 py: Enable optimisation of multiplying 2 small ints in compiler.
9 years ago
Damien George ecf5b77123 py: This time, real proper overflow checking of small int power.
9 years ago
Damien George 094d450003 py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.
9 years ago
Damien George af6edc61bd py: Enable a jump optimisation in the compiler.
9 years ago
Damien George 882b363564 py: Move to Python 3.4.0 compatibility.
9 years ago
Damien George 3ff2d03891 py: Fix bug in optimised for .. range.
9 years ago
Damien George e337f1ef5e py: Towards default keyword arguments.
9 years ago
Damien George 1aa2c10263 Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George 3056509e00 py: Rename and reorder parameters in emit_make_function/closure.
9 years ago
Paul Sokolovsky 96eec4f8a6 compile: Don't try to constant-fold division by zero.
9 years ago
Damien George 804760bfca py: Fix bug in compiler for empty class bases.
9 years ago
Damien George d17926db71 Rename rt_* to mp_*.
9 years ago
Paul Sokolovsky 8d9cc2e669 compile: Print error messages on unimplemented relative imports.
9 years ago
Damien George 21a07dc50f Merge pull request #389 from pfalcon/with-statement
9 years ago
Damien George d1e443d0bc py: Free unique_code slot for outer module.
9 years ago
Paul Sokolovsky 44307d5ef8 vm: Implement "with" statement (SETUP_WITH and WITH_CLEANUP bytecodes).
9 years ago
Damien George 2326d52d20 py: Factor out code from runtime.c to emitglue.c.
9 years ago
Damien George 8dcc0c7924 py: Calculate maximum exception stack size in compiler.
9 years ago
Damien George bdcbf0fcd1 py: Restore CPython compatibility in compiler for closures with def args.
9 years ago
Paul Sokolovsky 2447a5b582 py: Support closures with default args.
9 years ago
Rachel Dowdall 56402796d8 Fixed floor division on mp ints and small ints. Added a floordivide test case.
9 years ago
Rachel Dowdall cde8631f15 Fixed modulo operator on ints and mp ints to agree with python. Added intdivmod.c and tests/basics/modulo.py.
9 years ago
xbe efe3422394 py: Clean up includes.
9 years ago
Damien George f41fdd05b0 py: Unify syntax error handling in compiler; check defualt arg syntax.
9 years ago
Damien George 1dc76af7bf py: Remove name of var arg from macros with var args.
9 years ago
Paul Sokolovsky 56e5ef203b parse: Refactor parse node encoding to support full range of small ints.
9 years ago
Paul Sokolovsky bbf0e2fe12 parse: Note that fact that parser's small ints are different than VM small int.
9 years ago
Paul Sokolovsky a1aba36feb compile: Add comments ergarding non-implemented relative imports.
9 years ago
Damien George 8725f8f7de py: Pass all scope flags through to runtime.
9 years ago
Paul Sokolovsky 520e2f58a5 Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.
9 years ago
Paul Sokolovsky 2f0b026a44 Clean up handling of function return type annotation.
9 years ago