Damien George
ff8dd3f486
py, unix: Allow to compile with -Wunused-parameter.
See issue #699 .
10 years ago
Damien George
963a5a3e82
py, unix: Allow to compile with -Wsign-compare.
See issue #699 .
10 years ago
Damien George
51dfcb4bb7
py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022 .
10 years ago
Damien George
42f3de924b
py: Convert [u]int to mp_[u]int_t where appropriate.
Addressing issue #50 .
10 years ago
Damien George
4d91723587
py: Remove use of int type in obj.h.
Part of code cleanup, working towards resolving issue #50 .
10 years ago
Damien George
d182b98a37
py: Change all uint to mp_uint_t in obj.h.
Part of code cleanup, working towards resolving issue #50 .
10 years ago
Damien George
40f3c02682
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue #50 .
11 years ago
Chris Angelico
1f44e118f0
Remove unnecessary bounds check from mp_seq_get_fast_slice_indexes.
At this point, start will be >= 0, so checking if stop < 0 is redundant with
checking if start > stop a few lines later.
11 years ago
Damien George
c49ddb9315
py: Fix configurability of builtin slice.
11 years ago
Paul Sokolovsky
5fd5af98d0
objlist: Implement support for arbitrary (3-arg) slices.
11 years ago
Paul Sokolovsky
de4b9329f9
py: Refactor slice helpers, preparing to support arbitrary slicing.
11 years ago
Paul Sokolovsky
ff4b6daa4f
sequence: Throw exception for not implemented slice steps.
11 years ago
Paul Sokolovsky
69d081a7cf
py: Handle case of slice start > stop in common sequence function.
11 years ago
Paul Sokolovsky
afaaf535e6
objslice: Support arbitrary objects start, stop, and step.
Older int-only encoding is not expressive enough to support arbitrary slice
assignment operations.
11 years ago
Paul Sokolovsky
ad3baec12f
sequence: Fix yet another case of improper sequence comparison.
This time, in mp_seq_cmp_bytes(). How many more cases are still lurking?
11 years ago
Paul Sokolovsky
da9f0924ef
py, unix: Add copyright for modules I worked closely on.
11 years ago
Paul Sokolovsky
d915a52eb6
py: Fix prefix on few sequence helpers, was incorrectly "mp_".
11 years ago
Paul Sokolovsky
7b0f9a7d9b
bytes: Implement comparison and other binary operations.
Should support everything supported by strings.
11 years ago
Damien George
04b9147e15
Add license header to (almost) all files.
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/.
11 years ago
Paul Sokolovsky
f54bcbf099
py, unix: Make "mpconfig.h" be first included, as other headers depend on it.
Specifically, nlr.h does.
11 years ago
Paul Sokolovsky
0fc4775cd6
sequence: Further simplify sequence comparison.
11 years ago
Paul Sokolovsky
83eba5dec5
sequence: Fix glaring bug in sequence comparison.
11 years ago
Damien George
ea13f407a3
py: Change nlr_jump to nlr_raise, to aid in debugging.
This does not affect code size or performance when debugging turned off.
To address issue #420 .
11 years ago
Damien George
df6567e634
Merge map.h into obj.h.
Pretty much everyone needs to include map.h, since it's such an integral
part of the Micro Python object implementation. Thus, the definitions
are now in obj.h instead. map.h is removed.
11 years ago
Damien George
d17926db71
Rename rt_* to mp_*.
Mostly just a global search and replace. Except rt_is_true which
becomes mp_obj_is_true.
Still would like to tidy up some of the names, but this will do for now.
11 years ago
xbe
efe3422394
py: Clean up includes.
Remove unnecessary includes. Add includes that improve portability.
11 years ago
xbe
9e1e8cd642
Implement str.count and add tests for it.
Also modify mp_get_index to accept:
1. Indices that are or evaluate to a boolean.
2. Slice indices.
Add tests for these two cases.
11 years ago
Damien George
c5966128c7
Implement proper exception type hierarchy.
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.
11 years ago
Damien George
d46ca25757
Fix some int casting that failed on 64 bit architecture.
11 years ago
Paul Sokolovsky
ac0134d427
Factor out mp_seq_count_obj() and implement tuple.count().
11 years ago
Paul Sokolovsky
624eff6a8a
Implement tuple.index().
11 years ago
Paul Sokolovsky
0cd1dc06e6
Factor out mp_seq_index_obj() function to implement .index() on sequences.
11 years ago
Paul Sokolovsky
1a996c48ac
Refactor list comparison code to mp_seq_cmp_objs().
11 years ago
Paul Sokolovsky
87e85b7dc7
Implement str/bytes rich comparisons.
11 years ago
Paul Sokolovsky
7364af2d8c
Factor out m_seq_get_fast_slice_indexes() fucntions as sequence helper.
Takes slice object and sequence length and computes subsequence indexes
for case of slice step=1.
11 years ago
Paul Sokolovsky
439542f70c
sequence.c: Start to refactor sequence operations for reuse among types.
11 years ago