1. 06 May, 2014 1 commit
  2. 05 May, 2014 2 commits
    • Paul Sokolovsky's avatar
      f9e54e0e
    • Damien George's avatar
      py: Turn down amount of RAM parser and compiler use. · 66e18f04
      Damien George authored
      There are 2 locations in parser, and 1 in compiler, where memory
      allocation is not precise.  In the parser it's the rule stack and result
      stack, in the compiler it's the array for the identifiers in the current
      scope.  All other mallocs are exact (ie they don't allocate more than is
      needed).
      
      This patch adds tuning options (MP_ALLOC_*) to mpconfig.h for these 3
      inexact allocations.
      
      The inexact allocations in the parser should actually be close to
      logarithmic: you need an exponentially larger script (absent pathological
      cases) to use up more room on the rule and result stacks.  As such, the
      default allocation policy for these is now to start with a modest sized
      stack, but grow only in small increments.
      
      For the identifier arrays in the compiler, these now start out quite
      small (4 entries, since most functions don't have that many ids), and
      grow incrementally by 6 (since if you have more ids than 4, you probably
      have quite a few more, but it wouldn't be exponentially more).
      
      Partially addresses issue #560.
      66e18f04
  3. 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
  4. 30 Apr, 2014 2 commits
  5. 26 Apr, 2014 1 commit
  6. 25 Apr, 2014 1 commit
  7. 17 Apr, 2014 3 commits
  8. 15 Apr, 2014 1 commit
  9. 14 Apr, 2014 2 commits
  10. 13 Apr, 2014 3 commits
  11. 11 Apr, 2014 1 commit
  12. 10 Apr, 2014 2 commits
    • Damien George's avatar
      py: Add simple way of looking up constants in compiler. · 57e99ebc
      Damien George authored
      Working towards trying to support compile-time constants (see discussion
      in issue #227), this patch allows the compiler to look inside arbitrary
      uPy objects at compile time.  The objects to search are given by the
      macro MICROPY_EXTRA_CONSTANTS (so they must be constant/ROM objects),
      and the constant folding occures on forms base.attr (both base and attr
      must be id's).
      
      It works, but it breaks strict CPython compatibility, since the lookup
      will succeed even without importing the namespace.
      57e99ebc
    • Paul Sokolovsky's avatar
      py: Start implementing "struct" module. · e9db8404
      Paul Sokolovsky authored
      Only calcsize() and unpack() functions provided so far, for little-endian
      byte order. Format strings don't support repition spec (like "2b3i").
      
      Unfortunately, dealing with all the various binary type sizes and alignments
      will lead to quite a bloated "binary" helper functions  - if optimizing for
      speed. Need to think if using dynamic parametrized algos makes more sense.
      e9db8404
  13. 05 Apr, 2014 1 commit
  14. 03 Apr, 2014 1 commit
    • Paul Sokolovsky's avatar
      py: Add "io" module. · 98a627dc
      Paul Sokolovsky authored
      So far just includes "open" function, which should be supplied by a port.
      
      TODO: Make the module #ifdef'ed.
      98a627dc
  15. 25 Mar, 2014 1 commit
  16. 08 Mar, 2014 1 commit
    • Damien George's avatar
      Implement ROMable modules. Add math module. · 0c36da0b
      Damien George authored
      mp_module_obj_t can now be put in ROM.
      
      Configuration of float type is now similar to longint: can now choose
      none, float or double as the implementation.
      
      math module has basic math functions.  For STM port, these are not yet
      implemented (they are just stub functions).
      0c36da0b
  17. 22 Feb, 2014 1 commit
  18. 15 Feb, 2014 1 commit
    • Damien George's avatar
      Implement proper exception type hierarchy. · c5966128
      Damien George authored
      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.
      c5966128
  19. 14 Feb, 2014 1 commit
  20. 12 Feb, 2014 1 commit
  21. 06 Feb, 2014 1 commit
  22. 29 Jan, 2014 1 commit
  23. 19 Jan, 2014 1 commit
  24. 16 Jan, 2014 1 commit
  25. 13 Jan, 2014 1 commit
  26. 12 Jan, 2014 3 commits
  27. 07 Jan, 2014 3 commits
  28. 04 Jan, 2014 1 commit