Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
finish up multi-arity-limit, run the pre-existing tests
  • Loading branch information
timo committed Dec 25, 2013
1 parent 6c13c21 commit c248769
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/core/operators.pm
Expand Up @@ -104,11 +104,13 @@ sub SEQUENCE($left, Mu $right, :$exclude_end) {
my $stop;
while @left {
$value = @left.shift;
$end_tail.push($value);
if $value ~~ Code { $code = $value; last }
if $end_code_arity > 1 {
$end_tail.munch($end_tail.elems - $end_code_arity);
if $endpoint(|$end_tail) { $stop = 1; last }
$end_tail.push($value);
if +@$end_tail >= $end_code_arity {
$end_tail.munch($end_tail.elems - $end_code_arity);
if $endpoint(|@$end_tail) { $stop = 1; last }
}
} elsif $value ~~ $endpoint { $stop = 1; last }
$tail.push($value);
take $value;
Expand Down Expand Up @@ -175,9 +177,11 @@ sub SEQUENCE($left, Mu $right, :$exclude_end) {
$tail.munch($tail.elems - $count);
$value := $code(|$tail);
if $end_code_arity > 1 {
$end_tail.munch($tail.elems - $end_code_arity);
last if $endpoint(|$end_tail);
$end_tail.push($value);
unless $end_tail.elems < $end_code_arity {
$end_tail.munch($end_tail.elems - $end_code_arity);
last if $endpoint(|@$end_tail);
}
} else {
last if $value ~~ $endpoint;
}
Expand Down
2 changes: 1 addition & 1 deletion t/spectest.data
Expand Up @@ -198,7 +198,7 @@ S03-operators/value_equivalence.t
S03-sequence/arity0.t
S03-sequence/arity-2-or-more.t
S03-sequence/basic.t
# S03-sequence/limit-arity-2-or-more.t # err: Not enough positional parameters passed; got 1 but expected 2
S03-sequence/limit-arity-2-or-more.t
S03-sequence/misc.t
S03-sequence/nonnumeric.t
S03-smartmatch/any-any.t
Expand Down

0 comments on commit c248769

Please sign in to comment.