<commit_before>augment class Block {

=begin item arity

=end item
    method arity() {
        my $arity = 0;
        my @params = self.signature.params;
        for @params -> $p {
            $arity++ unless $p.slurpy || $p.optional;
        }
        $arity
    }

=begin item count

=end item
    method count() {
        my $count = 0;
        my @params = self.signature.params;
        for @params -> $p {
            $count++ unless $p.slurpy;
        }
        $count
    }

    method ACCEPTS($topic) {
        self.arity == 0 ?? self.() !! self.($topic);
    }

}

# vim: ft=perl6<commit_msg>Fix Block.ACCEPTS, which was the problem at the root of the 'grep bug'.<commit_after>augment class Block {

=begin item arity

=end item
    method arity() {
        my $arity = 0;
        my @params = self.signature.params;
        for @params -> $p {
            $arity++ unless $p.slurpy || $p.optional;
        }
        $arity
    }

=begin item count

=end item
    method count() {
        my $count = 0;
        my @params = self.signature.params;
        for @params -> $p {
            $count++ unless $p.slurpy;
        }
        $count
    }

    method ACCEPTS($topic) {
        self.count == 0 ?? self.() !! self.($topic);
    }

}

# vim: ft=perl6
{'fraction_non_alphanumeric': 0.13981042654028436, 'fraction_numerical': 0.00631911532385466, 'mean_word_length': 1.6786469344608879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6028802', 'n_tokens_mistral': 433, 'n_tokens_neox': 424, 'n_words': 115}