Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Comment out split() function for now; it causes the Parrot build to fail
Browse files Browse the repository at this point in the history
(during the building of opsc).  We can restore split() when the conflict
is repaired.
  • Loading branch information
pmichaud committed Sep 1, 2010
1 parent 29ce78f commit 5349f17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/setting/Regex.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,30 @@ our sub subst ($text, $regex, $repl, :$global?) {
Splits C<$text> on occurences of C<$regex>
=end item

our sub split ($regex, $text) {
my $pos := 0;
my @result;
my $looking := 1;
while $looking {
my $match :=
Regex::Cursor.parse($text, :rule($regex), :c($pos)) ;

if ?$match {
my $from := $match.from();
my $to := $match.to();
my $prefix := pir::substr__sPii($text, $pos, $from-$pos);
@result.push($prefix);
$pos := $match.to();
} else {
my $len := pir::length($text);
if $pos < $len {
@result.push(pir::substr__ssi($text, $pos) );
}
$looking := 0;
}
}
return @result;
}
# our sub split ($regex, $text) {
# my $pos := 0;
# my @result;
# my $looking := 1;
# while $looking {
# my $match :=
# Regex::Cursor.parse($text, :rule($regex), :c($pos)) ;
#
# if ?$match {
# my $from := $match.from();
# my $to := $match.to();
# my $prefix := pir::substr__sPii($text, $pos, $from-$pos);
# @result.push($prefix);
# $pos := $match.to();
# } else {
# my $len := pir::length($text);
# if $pos < $len {
# @result.push(pir::substr__ssi($text, $pos) );
# }
# $looking := 0;
# }
# }
# return @result;
# }


# vim: ft=perl6
File renamed without changes.

0 comments on commit 5349f17

Please sign in to comment.