Paul Sokolovsky
e0e79ae6d6
unix: Add basic implementation of io.FileIO object.
Note: only read/write/close methods are defined so far, and class
is not exposed (use open() factory function, as usual).
11 years ago
John R. Lenton
9c83ec0eda
Merge remote-tracking branch 'upstream/master' into dict_feats
11 years ago
Damien George
d3ebe4829d
Factor and simplify Makefile's and mpconfig, part 2.
11 years ago
Damien George
136f67523b
Factor and simplify Makefile's and mpconfig.
11 years ago
ian-v
5fd8fd2c16
Revert MP_BOOL, etc. and use <stdbool.h> instead
11 years ago
ian-v
7a16fadbf8
Co-exist with C++ (issue #85 )
11 years ago
Paul Sokolovsky
860ffb0a43
Convert many object types structs to use C99 tagged initializer syntax.
11 years ago
Damien George
71c5181a8d
Convert Python types to proper Python type hierarchy.
Now much more inline with how CPython does types.
11 years ago
Paul Sokolovsky
d674bd5989
Convert USE_READLINE config option to be consistent with others.
11 years ago
Damien George
eb7bfcb286
Split qstr into pools, and put initial pool in ROM.
Qstr's are now split into a linked-list of qstr pools. This has 2
benefits: the first pool can be in ROM (huge benefit, since we no longer
use RAM for the core qstrs), and subsequent pools use m_new for the next
pool instead of m_renew (thus avoiding a huge single table for all the
qstrs).
Still would be better to use a hash table, but this scheme takes us part
of the way (eventually convert the pools to hash tables).
Also fixed bug with import.
Also improved the way the module code is referenced (not magic number 1
anymore).
11 years ago
Damien George
e67ed5d285
Improve configurability for native x64/thumb emitter.
With MICROPY_EMIT_X64 and MICROPY_EMIT_THUMB disabled, the respective
emitters and assemblers will not be included in the code. This can
significantly reduce binary size for unix version.
11 years ago
Paul Sokolovsky
1c6de11f77
Add basic implementation of slice object.
So far, only start and stop integer indexes are supported. Step is
not supported, as well as objects of arbitrary types.
11 years ago
Paul Sokolovsky
c90c0f68a2
Move INT_FMT, etc. declaration into global mpconfig.h .
This in particular makes it available for stm port.
11 years ago
Paul Sokolovsky
b372bfca21
Rename default config file to mpconfig.h, and port's to mpconfigport.h.
mpconfig.h will automatically pull mpconfigport.h.
11 years ago
Damien George
1fb031744f
Change mp_compile so that it returns a function object for the module.
11 years ago
Damien George
66028ab6dc
Basic implementation of import.
import works for simple cases. Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
11 years ago
Damien George
2870862601
Add module object, to be used eventually for import.
11 years ago
Damien George
210a02e105
unix: revert Makefile to not use -ltermcap.
termcap is not needed on Linux. Need to work out how to automatically
configure the Makefile...
11 years ago
Edd Barrett
0d02eb178a
Fix undefined termcap symbols on OpenBSD.
E.g.:
/usr/lib/libreadline.so.4.0: undefined reference to `tgetnum'
/usr/lib/libreadline.so.4.0: undefined reference to `tgoto'
/usr/lib/libreadline.so.4.0: undefined reference to `tgetflag'
/usr/lib/libreadline.so.4.0: undefined reference to `tputs'
/usr/lib/libreadline.so.4.0: undefined reference to `tgetent'
/usr/lib/libreadline.so.4.0: undefined reference to `tgetstr'
Tested on linux too, works.
11 years ago
Edd Barrett
8146aea8ef
malloc.h is obsolete.
11 years ago
Paul Sokolovsky
fa027672da
Make GNU Readline usage optional (USE_READLINE define). Still enabled.
Readline is GPL, so linking with it casts the binary GPL.
11 years ago
Paul Sokolovsky
903b24f041
Add readline history support.
11 years ago
Paul Sokolovsky
e1151e463d
Use rm -rf to remove build dir, so it doesn't error out if dir doesn't exist.
11 years ago
Damien George
8cc96a35e5
Put unicode functions in unicode.c, and tidy their names.
11 years ago
Damien George
212c296c0b
Make unix-cpy cross platform; remove dependency of asmx64 on mpconfig.
11 years ago
Paul Sokolovsky
e85c38992d
Make "unix" target be crossplatform and support x86, x64, ARM hosts.
11 years ago
Damien
732407f1bf
Change memory allocation API to require size for free and realloc.
11 years ago
Paul Sokolovsky
729fd12fbf
Don't error out if build/ directory already exists.
11 years ago
Damien
de690d128b
Add unix-cpy, used to test Micro Python byte code against CPython.
11 years ago
Damien
b86e3f9293
py: implement some basic exception matching.
11 years ago
Damien
d99b05282d
Change object representation from 1 big union to individual structs.
A big change. Micro Python objects are allocated as individual structs
with the first element being a pointer to the type information (which
is itself an object). This scheme follows CPython. Much more flexible,
not necessarily slower, uses same heap memory, and can allocate objects
statically.
Also change name prefix, from py_ to mp_ (mp for Micro Python).
11 years ago
Damien
e2880aa2fd
Fix a few compiler warnings.
11 years ago
Damien
0f08267fa4
unix: include obj.h, and build additional py files.
11 years ago
Damien
1895cf91af
Link showbc.o in unix version.
11 years ago
Damien
087d218d95
Unix: add machine-specific sqrt support.
11 years ago
Damien
014e19fc4d
Fix compiler warnings in unix/main.c.
11 years ago
Damien
a53f694dc3
Test code for user objects.
11 years ago
Damien
7410e440ab
Add basic complex number support.
11 years ago
Damien
8b3a7c2237
Fix func decls with no arguments: () -> (void).
11 years ago
Damien
92c06561a3
Improve REPL compount statement detection.
11 years ago
Damien
d276f6357e
Get unix version compling.
11 years ago
Damien
fa2162bc77
Integrate new lexer stream with stm framework.
11 years ago
Damien
a5185f4bc8
Abstract out back-end stream functionality from lexer.
11 years ago
Damien
5ac1b2efbd
Implement REPL.
11 years ago
Damien
d2755ec538
Add iterators and comprehension to emitnative.
11 years ago
Damien
c9f91976e1
Crude try-except working.
11 years ago
Damien
ce89a21ea4
Implement basic exception framework, and simple for loop.
11 years ago
Damien
3ef4abb446
Change ifdef/if defined to simple if's.
11 years ago
Damien
c025ebb2dc
Separate out mpy core and unix version.
11 years ago