1. 16 Nov, 2016 4 commits
  2. 12 Oct, 2016 1 commit
    • Damien George's avatar
      py/lexer: Remove unnecessary code, and unreachable code. · 31101d91
      Damien George authored
      Setting emit_dent=0 is unnecessary because arriving in that part of the
      if-logic will guarantee that emit_dent is already zero.
      
      The block to check indent_top(lex)>0 is unreachable because a newline is
      always inserted an the end of the input stream, and hence dedents are
      always processed before EOF.
      31101d91
  3. 19 Sep, 2016 1 commit
    • Damien George's avatar
      py/vstr: Remove vstr.had_error flag and inline basic vstr functions. · 5da0d29d
      Damien George authored
      The vstr.had_error flag was a relic from the very early days which assumed
      that the malloc functions (eg m_new, m_renew) returned NULL if they failed
      to allocate.  But that's no longer the case: these functions will raise an
      exception if they fail.
      
      Since it was impossible for had_error to be set, this patch introduces no
      change in behaviour.
      
      An alternative option would be to change the malloc calls to the _maybe
      variants, which return NULL instead of raising, but then a lot of code
      will need to explicitly check if the vstr had an error and raise if it
      did.
      
      The code-size savings for this patch are, in bytes: bare-arm:188,
      minimal:456, unix(NDEBUG,x86-64):368, stmhal:228, esp8266:360.
      5da0d29d
  4. 20 May, 2016 1 commit
  5. 13 Apr, 2016 1 commit
    • pohmelie's avatar
      py: add async/await/async for/async with syntax · 81ebba7e
      pohmelie authored
      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`.
      81ebba7e
  6. 25 Feb, 2016 1 commit
    • Damien George's avatar
      py: Add MICROPY_DYNAMIC_COMPILER option to config compiler at runtime. · ea235204
      Damien George authored
      This new compile-time option allows to make the bytecode compiler
      configurable at runtime by setting the fields in the mp_dynamic_compiler
      structure.  By using this feature, the compiler can generate bytecode
      that targets any MicroPython runtime/VM, regardless of the host and
      target compile-time settings.
      
      Options so far that fall under this dynamic setting are:
      - maximum number of bits that a small int can hold;
      - whether caching of lookups is used in the bytecode;
      - whether to use unicode strings or not (lexer behaviour differs, and
        therefore generated string constants differ).
      ea235204
  7. 18 Dec, 2015 1 commit
    • Damien George's avatar
      py: Add MICROPY_ENABLE_COMPILER and MICROPY_PY_BUILTINS_EVAL_EXEC opts. · dd5353a4
      Damien George authored
      MICROPY_ENABLE_COMPILER can be used to enable/disable the entire compiler,
      which is useful when only loading of pre-compiled bytecode is supported.
      It is enabled by default.
      
      MICROPY_PY_BUILTINS_EVAL_EXEC controls support of eval and exec builtin
      functions.  By default they are only included if MICROPY_ENABLE_COMPILER
      is enabled.
      
      Disabling both options saves about 40k of code size on 32-bit x86.
      dd5353a4
  8. 07 Sep, 2015 3 commits
  9. 23 Jul, 2015 1 commit
  10. 22 Jun, 2015 1 commit
  11. 09 Jun, 2015 1 commit
  12. 20 May, 2015 1 commit
  13. 19 Mar, 2015 1 commit
  14. 08 Feb, 2015 1 commit
    • Damien George's avatar
      py: Parse big-int/float/imag constants directly in parser. · 7d414a1b
      Damien George authored
      Previous to this patch, a big-int, float or imag constant was interned
      (made into a qstr) and then parsed at runtime to create an object each
      time it was needed.  This is wasteful in RAM and not efficient.  Now,
      these constants are parsed straight away in the parser and turned into
      objects.  This allows constants with large numbers of digits (so
      addresses issue #1103) and takes us a step closer to #722.
      7d414a1b
  15. 30 Jan, 2015 1 commit
  16. 28 Jan, 2015 1 commit
  17. 16 Jan, 2015 1 commit
  18. 07 Jan, 2015 1 commit
  19. 01 Jan, 2015 1 commit
  20. 05 Dec, 2014 2 commits
  21. 09 Oct, 2014 1 commit
  22. 30 Jul, 2014 1 commit
  23. 03 Jul, 2014 1 commit
  24. 26 Jun, 2014 1 commit
  25. 21 Jun, 2014 1 commit
  26. 19 Jun, 2014 1 commit
  27. 14 Jun, 2014 1 commit
  28. 03 Jun, 2014 1 commit
  29. 02 Jun, 2014 1 commit
  30. 21 May, 2014 1 commit
    • Damien George's avatar
      Tidy up some configuration options. · 58ebde46
      Damien George authored
      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.
      58ebde46
  31. 12 May, 2014 1 commit
    • Damien George's avatar
      py: Add support for __debug__ constant. · 97f9a281
      Damien George authored
      __debug__ now resolves to True or False.  Its value needs to be set by
      mp_set_debug().
      
      TODO: call mp_set_debug in unix/ port.
      
      TODO: optimise away "if False:" statements in compiler.
      97f9a281
  32. 10 May, 2014 1 commit
  33. 03 May, 2014 1 commit
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      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/.
      04b9147e
  34. 10 Apr, 2014 1 commit