Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
79b7fe2e
Commit
79b7fe2e
authored
Jun 14, 2014
by
Paul Sokolovsky
Browse files
objstrunicode: Implement iterator.
parent
cdc020da
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objstrunicode.c
View file @
79b7fe2e
...
...
@@ -330,8 +330,10 @@ STATIC mp_obj_t str_it_iternext(mp_obj_t self_in) {
mp_obj_str_it_t
*
self
=
self_in
;
GET_STR_DATA_LEN
(
self
->
str
,
str
,
len
);
if
(
self
->
cur
<
len
)
{
mp_obj_t
o_out
=
mp_obj_new_str
((
const
char
*
)
str
+
self
->
cur
,
1
,
true
);
self
->
cur
+=
1
;
const
byte
*
cur
=
str
+
self
->
cur
;
const
byte
*
end
=
utf8_next_char
(
str
+
self
->
cur
);
mp_obj_t
o_out
=
mp_obj_new_str
((
const
char
*
)
cur
,
end
-
cur
,
true
);
self
->
cur
+=
end
-
cur
;
return
o_out
;
}
else
{
return
MP_OBJ_STOP_ITERATION
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment