Merge branch 'cplusplus' of https://github.com/ian-v/micropython into ian-v-cplusplus

Conflicts:
	py/objcomplex.c
This commit is contained in:
Damien George
2014-01-07 15:58:30 +00:00
30 changed files with 117 additions and 244 deletions

View File

@@ -184,17 +184,19 @@ mp_obj_t str_format(int n_args, const mp_obj_t *args) {
static MP_DEFINE_CONST_FUN_OBJ_2(str_join_obj, str_join);
static MP_DEFINE_CONST_FUN_OBJ_VAR(str_format_obj, 1, str_format);
static const mp_method_t str_type_methods[] = {
{ "join", &str_join_obj },
{ "format", &str_format_obj },
{ NULL, NULL }, // end-of-list sentinel
};
const mp_obj_type_t str_type = {
{ &mp_const_type },
"str",
.print = str_print,
.binary_op = str_binary_op,
.getiter = str_getiter,
.methods = {
{ "join", &str_join_obj },
{ "format", &str_format_obj },
{ NULL, NULL }, // end-of-list sentinel
},
.methods = str_type_methods,
};
mp_obj_t mp_obj_new_str(qstr qstr) {
@@ -235,7 +237,6 @@ static const mp_obj_type_t str_it_type = {
{ &mp_const_type },
"str_iterator",
.iternext = str_it_iternext,
.methods = { { NULL, NULL }, },
};
mp_obj_t mp_obj_new_str_iterator(mp_obj_str_t *str, int cur) {