Ticket #1456 (closed patch: fixed)

Opened 12 years ago

Last modified 11 years ago

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.

Attachments

string-iter-v4.diff Download (71.6 KB) - added by nwellnhof 12 years ago.
Proposed patch
string-iter-remove-old-api-v4.diff Download (27.9 KB) - added by nwellnhof 12 years ago.
Incremental patch that removes the old API
string-iter-v5.diff Download (71.2 KB) - added by nwellnhof 12 years ago.
Proposed patch
string-iter-remove-old-api-v5.diff Download (27.1 KB) - added by nwellnhof 12 years ago.
Incremental patch that removes the old API
string-iter-v6.diff Download (69.9 KB) - added by nwellnhof 12 years ago.
Merge with trunk
string-iter-remove-old-api-v6.diff Download (27.1 KB) - added by nwellnhof 12 years ago.
string-iter-v7.diff Download (84.2 KB) - added by nwellnhof 11 years ago.
string-iter-remove-old-api-v7.diff Download (33.1 KB) - added by nwellnhof 11 years ago.

Change History

Changed 12 years ago by nwellnhof

Proposed patch

Changed 12 years ago by nwellnhof

Incremental patch that removes the old API

Changed 12 years ago by nwellnhof

Here is another version v5 of the patch that addresses the issue reported in TT#1482. It also contains bug fixes for the utf8 iter_get and iter_skip versions.

Changed 12 years ago by nwellnhof

Proposed patch

Changed 12 years ago by nwellnhof

Incremental patch that removes the old API

Changed 12 years ago by nwellnhof

Merge with trunk

Changed 12 years ago by nwellnhof

Changed 11 years ago by nwellnhof

Merged patches against r48357 follow. (I'm using dukeleto's Github repo which doesn't get updated very often.)

Changed 11 years ago by nwellnhof

Changed 11 years ago by nwellnhof

Changed 11 years ago by chromatic

  • status changed from new to closed
  • resolution set to fixed

Thanks, both applied as of r48565. I apologize for the long delay.

Note: See TracTickets for help on using tickets.