summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-05-05py-version.sh: Use --always option of git describe.Paul Sokolovsky
2014-05-05py: Turn down amount of RAM parser and compiler use.Damien George
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.
2014-05-05py-version.sh: Make it work in case no git tag is present.Paul Sokolovsky
2014-05-05py, unix: Add -v option, print bytecode dump if used.Paul Sokolovsky
This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for unix/windows ports. This makes it convenient to user uPy normally, but easily get bytecode dump on the spot if needed, without constant recompiles back and forth. TODO: Add more useful debug output, adjust verbosity level on which specifically bytecode dump happens.
2014-05-04showbc: Quote block name, so it was easily visible.Paul Sokolovsky
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-05-03Merge pull request #535 from pfalcon/blurbDamien George
Proposed license/copyright file header.
2014-05-03Merge branch 'mingw-float-printf' of github.com:stinos/micropython into ↵Damien George
stinos-mingw-float-printf
2014-05-03py, stream: Implement readlines for a stream.Damien George
2014-05-03py: Add --dirty flag to git describe.Damien George
2014-05-03mingw: Fix number of exponent digits in floating point formattingstijn
By default mingw outputs 3 digits instead of the standard 2 so all float tests using printf fail. Using setenv at the start of the program fixes this. To accomodate calling platform specific initialization a MICROPY_MAIN_INIT_FUNC macro is used which is called in mp_init()
2014-05-03py: Print tag/version/git describe in uPy banner.Damien George
2014-05-03stmhal: Enable cmath module.Damien George
2014-05-03py, objtype.c: Rename class_ to instance_ following change of typedef.Damien George
This follows up 0a7e01ae3c529fddf79dc5c71bf7e43cff3f9fa0.
2014-05-03Merge pull request #546 from stinos/relax-makeqstrdataDamien George
More relaxed parsing of preprocessed qstr header
2014-05-03Merge pull request #552 from stinos/mingw-allocaPaul Sokolovsky
py: Use <alloca.h> for alloca()
2014-05-03objclosure, objcell: Print detailed representation if was requested.Paul Sokolovsky
Well, it is bound to "detailed error reporting", but that's closest what we have now without creating new entities.
2014-05-03More relaxed parsing of preprocessed qstr headerstijn
The original parsing would error out on any C declarations that are not typedefs or extern variables. This limits what can go in mpconfig.h and mpconfigport.h, as they are included in qstr.h. For instance even a function declaration would be rejected and including system headers is a complete no-go. That seems too limiting for a global config header, so makeqstrdata now ignores everything that does not match a qstr definition.
2014-05-03py: Use <alloca.h> for alloca()stijn
alloca() is declared in alloca.h which als happens to be included by stdlib.h. On mingw however it resides in malloc.h only. So if we include alloca.h directly, and add an alloca.h for mingw in it's port directory we can get rid of the mingw-specific define to include malloc.h and the other ports are happy as well.
2014-05-02py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky
Specifically, nlr.h does.
2014-05-02objtype: Work around stupid strict aliasing check.Paul Sokolovsky
2014-05-02objexcept: Support tracebacks for user Exception subclasses.Paul Sokolovsky
2014-05-02objtype: Rename mp_obj_class_t -> mp_obj_instance_t and move to local header.Paul Sokolovsky
TODO: Rename methods.
2014-05-02objtype: .print() Exception instances in adhoc way.Paul Sokolovsky
This is ugly, just as expected.
2014-05-01Merge pull request #544 from lurch/fix-minmaxPaul Sokolovsky
Fix the builtin min() and max() functions (and add tests).
2014-05-01objfun: More debug logging.Paul Sokolovsky
2014-05-01objgenerator: Fix check for too few args passed to gen function.Paul Sokolovsky
2014-05-01objgenerator: .print(): Output real underlying function name.Paul Sokolovsky
2014-05-01Fix the builtin min() and max() functions (and add tests).Andrew Scheller
Fixes #539
2014-05-01py: Add copyright/license header to each file.Paul Sokolovsky
2014-05-01py: Add tentative scheme for error messages configuration.Paul Sokolovsky
2014-05-01objfun: Add function name accessor and .print slot method.Paul Sokolovsky
2014-04-30Merge pull request #528 from pfalcon/native-subclass1Damien George
Initial support for subclassing native types
2014-04-30objfun: Factor out function to report positional args mismatch.Paul Sokolovsky
2014-04-30py: Abstract no-return attribute for functions a bit.Paul Sokolovsky
2014-04-30py: If setjmp NLR implementation is forced, omit native versions.Paul Sokolovsky
2014-04-30nlr.h: As we treat all warnings as errors, can't use #warning.Paul Sokolovsky
And this is not good.
2014-04-30objtype: Support calling normal methods inherited from native base class.Paul Sokolovsky
Biggest part of this support is refactoring mp_obj_class_lookup() to return standard "bound member" pair (mp_obj_t[2]). Actual support of inherited native methods is 3 lines then. Some inherited features may be not supported yet (e.g. native class methods, native properties, etc., etc.). There may be opportunities for further optimization too.
2014-04-29objtype: Add support for looking up non-method attrs in native base class.Paul Sokolovsky
2014-04-29objtype: Implement basic framework for subclassing native types.Paul Sokolovsky
This implements checking of base types, allocation and basic initialization, and optimized support for special method lookups. Other features are not yet supported.
2014-04-28py: Fix bug in map lookup of interned string vs non-interned.Damien George
Had choice of either interning or forcing full equality comparison, and chose latter. See comments in mp_map_lookup. Addresses issue #523.
2014-04-28py: Fix lexerunix, where not all data may be read from a file.Damien George
Addresses issue #526.
2014-04-28py: Remove silly comment about interning keywords.Damien George
Of course, keywords are turned into lexer tokens in the lexer, so will never need to be interned (unless you do something like x="def"). As it is now, the following on pyboard makes no new qstrs: import pyb pyb.info()
2014-04-28py: Clear allocated, but unused memory in containers.Paul Sokolovsky
Also, clear up freed slots in containers. As a follow up to 32bef315be8e56ad2d7f69223fe7b9606893b6ab.
2014-04-28objlist: We no longer need to assert on mem alloc results.Paul Sokolovsky
They either succeed or raise exception.
2014-04-28objlist: Use static small int constructor.Paul Sokolovsky
2014-04-27py: Add '*' qstr for 'import *'; use blank qstr for comprehension arg.Damien George
2014-04-27py: Remove unnecessary LOAD_CONST_ID bytecode.Damien George
It's the same as LOAD_CONST_STR.
2014-04-27py: Eliminate 'op' variable in VM dispatch loop.Damien George
Remembering the last op is rarely needed, and when it is, can simply use *save_ip.
2014-04-27py: Save some ROM by shortening compiler error messages.Damien George
Messages are still explanatory, while taking a little less ROM.