Ticket #1456 (closed patch: fixed)
String iterator rewrite
Reported by: | nwellnhof | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | none | Version: | 2.1.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
Here is another version of my attempt to rewrite the string iterator API. It does the following:
1. Remove the members str, get_and_advance, set_and_advance and set_position from struct string_iterator_t, keeping only bytepos and charpos.
2. Switch the internal string iterator API to the following new macros:
STRING_ITER_INIT(i, iter) STRING_ITER_GET(i, str, iter, offset) STRING_ITER_SKIP(i, str, iter, skip) STRING_ITER_GET_AND_ADVANCE(i, str, iter) STRING_ITER_SET_AND_ADVANCE(i, str, iter, c) STRING_ITER_SET_POSITION(i, str, iter, pos)
3. Change the string iterator PMC to actually use string iterators.
4. Rewrite Parrot_str_split to use string iterators.
The patch is split in two parts. The first part makes the changes described above but keeps the old API. The second part removes the old API.