Damien George
87e380b7ea
Merge pull request #461 from lurch/patch-1
Update mkrules.mk
11 years ago
Damien George
686afc5c0a
py: Check that sequence has 2 elements for dict iterable constructor.
11 years ago
Paul Sokolovsky
be019ce063
objdict: Implement construction from iterable of pairs.
Pairs are limited to tuples so far.
11 years ago
Paul Sokolovsky
12a04392b9
objdict: Implement __getitem__ method.
11 years ago
Paul Sokolovsky
263853ef84
modffi: Update for latest binary API refactors.
11 years ago
Paul Sokolovsky
0c43cf9154
modstruct: Basic implementation of native struct alignment and types.
11 years ago
Paul Sokolovsky
ef9124f5ff
binary: Rename array accessors for clarity.
11 years ago
Paul Sokolovsky
2da81fa80c
mpconfig.h: Add basic support for target endianness configuration.
A specific target can define either MP_ENDIANNESS_LITTLE or MP_ENDIANNESS_BIG
to 1. Default is MP_ENDIANNESS_LITTLE.
TODO: Autodetect based on compiler predefined macros?
11 years ago
Paul Sokolovsky
6582d64d01
modstruct: Refactor to support both LE and BE packed structs.
11 years ago
Andrew Scheller
83346749da
Update mkrules.mk
make 'make clean' cleaner ;-)
11 years ago
Damien George
2b9419b5bf
Merge pull request #460 from lurch/patch-2
Update .gitignore
11 years ago
Damien George
037b3e0e21
Merge pull request #458 from lurch/patch-1
Tweak pybcdc.inf to match recent changes to pybcdc.h
11 years ago
Damien George
3f4898456b
stmhal: Add stm module, which contains some constants for the MCU.
Also contains raw memory read/write functions, read8, read16, read32,
write8, write16, write32. Can now do:
stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
This turns on the red LED.
With the new constant folding, the above constants for the GPIO address
are actually compiled to constants (and the addition done) at compile
time. For viper code and inline assembler, this optimisation will make
a big difference. In the inline assembler, using these constants would
not be possible without this constant folding.
11 years ago
Damien George
57e99ebc86
py: Add simple way of looking up constants in compiler.
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.
11 years ago
Andrew Scheller
4391c8f38e
Update .gitignore
Add test failure logs
11 years ago
Damien George
ae491055fa
py: Fix float/complex binop returning NULL; implement complex power.
11 years ago
Damien George
f31b6ff334
tests: Add test for multi-comparison.
11 years ago
Damien George
d66ae18640
py: Simplify stack get/set to become stack adjust in emitters.
Can do this now that the stack size calculation is improved.
11 years ago
Damien George
069a35e3a5
py, compiler: Improve stack depth counting.
Much less of a hack now. Hopefully it's correct!
11 years ago
Damien George
190d1ba297
py: Make sure state/stack of byte code function has at least 1 slot.
11 years ago
Damien George
a1ef441d18
py: Fix VM stack overflow detection.
11 years ago
Damien George
e90be0ddf5
py: Add option to VM to detect stack overflow.
11 years ago
Damien George
c90717a3e4
py: Add missing dummy functions to pass 1 emitter.
11 years ago
Damien George
58ba4c3b4c
py: Check explicitly for memory allocation failure in parser.
Previously, a failed malloc/realloc would throw an exception, which was
not caught. I think it's better to keep the parser free from NLR
(exception throwing), hence this patch.
11 years ago
Damien George
ffa9bddfc4
Make lexerunix not allocate RAM for the entire script.
Now reads in small chunks at a time.
11 years ago
Damien George
f0954e3fac
py: Add emergency exception object for when heap allocation fails.
11 years ago
Damien George
6f355fd3b9
py: Make labels unsigned ints (converted from int).
Labels should never be negative, and this modified type signature
reflects that.
11 years ago
Damien George
bf8ae4d96e
py: Fix modstruct to compile on 64-bit machine.
11 years ago
Damien George
3a8b1607fc
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
635543c72c
py, compiler: Implement compiling of relative imports.
11 years ago
Damien George
2e9eb2d207
py: Fix lexer so it doesn't allow ! and ..
11 years ago
Damien George
175cecfa87
py: Make form-feed character a space (following C isspace).
Eg, in CPython stdlib, email/header.py has a form-feed character.
11 years ago
Damien George
a91f41407b
py, lexer: Fix parsing of raw strings (allow escaping of quote).
11 years ago
Damien George
f22626ee4f
unix: Add option to only compile, and not execute code.
11 years ago
Paul Sokolovsky
978607aeff
objfun: Fix default arguments filling loop, was broken in presense of kwargs.
11 years ago
Paul Sokolovsky
41e2dea4ca
objfun: More debug logging when calling a bytecode function.
11 years ago
Andrew Scheller
fec6f018ee
Tweak pybcdc.inf to match recent changes to pybcdc.h
11 years ago
Paul Sokolovsky
e9db840480
py: Start implementing "struct" module.
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.
11 years ago
Paul Sokolovsky
acb133d1b1
makeqstrdata.py: Add support for conditionally defined qstrs.
Syntax is usual C #if*/#endif, but each qstr must be wrapped individually.
11 years ago
Paul Sokolovsky
881d9af05e
objstr: Add TODO-optimize for using .join with arbitrary iterable.
11 years ago
Damien George
87bb093eb6
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
7a5f9e94ad
stmhal: Make /src/main.py just /main.py; allow SD to be used as root device.
11 years ago
Damien George
1d2ba5ddf9
Merge pull request #455 from lurch/exception-messages
Remove exception name from inside the exception message
11 years ago
Damien George
038fd52faa
Merge branch 'str-index' of github.com:xbe/micropython into xbe-str-index
11 years ago
Damien George
5589db88c7
py: Implement complex division.
11 years ago
Damien George
e2835c16f4
py: Oops, fix emitcpy to compile with latest changes.
11 years ago
Andrew Scheller
f78cfaf8b5
Remove exception name from inside the exception message
This prevents micropython printing exception messages like
ImportError: ImportError: No module named 'foo'
11 years ago
Damien George
b5fbd0ba87
py: Add mp_obj_is_integer; make mp_get_index check for long int.
mp_obj_is_integer should be used to check if an object is of integral
type. It returns true for bool, small int and long int.
11 years ago
Damien George
d99944acdd
py: Clear state to MP_OBJ_NULL before executing byte code.
11 years ago
Damien George
a157e4caba
py: str.join can now take arbitrary iterable as argument.
11 years ago