Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix sequences with Junction endpoints.

  • Loading branch information...
commit 3c475e3f40d46b2298dec55b2b1f8ac34f8d46d5 1 parent 4eca84f
@jnthn jnthn authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/operators.pm
View
8 src/core/operators.pm
@@ -79,8 +79,8 @@ multi infix:<but>(Mu:U \obj, @roles) {
obj.HOW.mixin(obj, |@roles)
}
-sub SEQUENCE($left, $right, :$exclude_end) {
- my @right := $right.flat;
+sub SEQUENCE($left, Mu $right, :$exclude_end) {
+ my @right := nqp::istype($right, Junction) ?? [$right] !! $right.flat;
my $endpoint = @right.shift;
my $infinite = $endpoint ~~ Whatever || $endpoint === $Inf;
$endpoint = Bool::False if $infinite;
@@ -178,10 +178,10 @@ sub WHAT(\x) {
}
proto sub infix:<...>(|) { * }
-multi sub infix:<...>($a, $b) { SEQUENCE($a, $b) }
+multi sub infix:<...>($a, Mu $b) { SEQUENCE($a, $b) }
proto sub infix:<...^>(|) { * }
-multi sub infix:<...^>($a, $b) { SEQUENCE($a, $b, :exclude_end(1)) }
+multi sub infix:<...^>($a, Mu $b) { SEQUENCE($a, $b, :exclude_end(1)) }
sub undefine(Mu \x) {
my $undefined;
Please sign in to comment.
Something went wrong with that request. Please try again.