Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git@github.com:viklund/november

Conflicts:
	p6w/Makefile.in
  • Loading branch information...
commit da54d4fc11532beeeb93814364fc5655c9582ec4 2 parents 9827ffc + 15da5f3
@masak masak authored
View
5 lib/Dispatcher.pm
@@ -9,7 +9,7 @@ class Dispatcher {
@!rules.push($rule);
}
- multi method add (@tokens, $action){
+ multi method add (@tokens, $action) {
my $rule = Dispatcher::Rule.new( tokens => @tokens, action => $action );
@!rules.push($rule);
}
@@ -29,8 +29,7 @@ class Dispatcher {
my @matched = @!rules.grep: { .match(@chunks); };
if @matched {
- # RAKUDO: [*-1] do not work in array-attribute [perl #61766]
- my $result = @matched[@matched.end].apply;
+ my $result = @matched[*-1].apply;
.clear for @!rules;
return $result;
}
View
2  lib/Dispatcher/Rule.pm
@@ -5,7 +5,7 @@ has $.action;
method match (@chunks) {
return False if @chunks != @.tokens;
- for @.tokens Z @chunks -> Object $token, $chunk {
+ for @chunks Z @.tokens-> Str $chunk, Object $token {
if ~$chunk ~~ $token {
@!args.push($/) if $/;
}
View
2  t/dispatcher/01.t
@@ -95,7 +95,7 @@ is( $d.dispatch(['summ', '2', '3']),
$d.add: ['summ', / \w+ /, 1|2 ], { $^a ~ "oo" };
-is( $d.dispatch(['summ', 'Z', 2]),
+is( $d.dispatch(['summ', 'Z', '2']),
'Zoo',
'Rule with a regexp and a junction'
);
Please sign in to comment.
Something went wrong with that request. Please try again.