Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Work on a fixed width string.
Sadly, this can't actually be merged yet, for the same reason we can
not substr strings in the grammar from fixed width.
  • Loading branch information
jnthn committed Sep 19, 2012
1 parent f843f61 commit 11e00a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/Str.pm
Expand Up @@ -738,9 +738,10 @@ my class Str does Stringy {

method words(Str:D: $limit = $Inf) {
my $taken = 0;
my str $str = nqp::unbox_s(self);
my int $eos = nqp::chars($str);
my int $pos = 0;
my str $orig = nqp::unbox_s(self);
my str $str = pir::trans_encoding__Ssi($orig, pir::find_encoding__Is('ucs4'));
my int $eos = nqp::chars($str);
my int $pos = 0;
gather while $taken < $limit {
my int $start = nqp::findnotcclass(
pir::const::CCLASS_WHITESPACE, $str, $pos, $eos);
Expand Down

0 comments on commit 11e00a9

Please sign in to comment.