<commit_before>class Regex::P6Regex::Actions;

method TOP($/) {
    my $past := PAST::Regex.new(
        $<nibbler>.ast,
        PAST::Regex.new( :pasttype('pass') ),
        :pasttype('concat')
    );
    make $past;
}

method nibbler($/) {
    make $<termish>[0].ast;
}

method termish($/) {
    my $past := PAST::Regex.new( :pasttype('concat') );
    for $<noun> {
        $past.push($_.ast);
    }
    make $past;
}

method quantified_atom($/) {
    my $past := $<atom>.ast;
    if $<quantifier> {
       $<quantifier>[0].ast.unshift($past);
       $past := $<quantifier>[0].ast;
    }
    make $past;
}

method atom($/) {
    my $past := PAST::Regex.new( ~$/ , :pasttype('literal') );
    make $past;
}

method quantifier:sym<*>($/) {
    my $past := PAST::Regex.new( :pasttype('quant') );
    make $past;
}<commit_msg>Add + and ? quantifiers.<commit_after>class Regex::P6Regex::Actions;

method TOP($/) {
    my $past := PAST::Regex.new(
        $<nibbler>.ast,
        PAST::Regex.new( :pasttype('pass') ),
        :pasttype('concat')
    );
    make $past;
}

method nibbler($/) {
    make $<termish>[0].ast;
}

method termish($/) {
    my $past := PAST::Regex.new( :pasttype('concat') );
    for $<noun> {
        $past.push($_.ast);
    }
    make $past;
}

method quantified_atom($/) {
    my $past := $<atom>.ast;
    if $<quantifier> {
       $<quantifier>[0].ast.unshift($past);
       $past := $<quantifier>[0].ast;
    }
    make $past;
}

method atom($/) {
    my $past := PAST::Regex.new( ~$/ , :pasttype('literal') );
    make $past;
}

method quantifier:sym<*>($/) {
    my $past := PAST::Regex.new( :pasttype('quant') );
    make $past;
}

method quantifier:sym<+>($/) {
    my $past := PAST::Regex.new( :pasttype('quant'), :min(1) );
    make $past;
}

method quantifier:sym<?>($/) {
    my $past := PAST::Regex.new( :pasttype('quant'), :min(0), :max(1) );
    make $past;
}
{'fraction_non_alphanumeric': 0.23259493670886075, 'fraction_numerical': 0.0058016877637130804, 'mean_word_length': 2.8323232323232324, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '2107337', 'n_tokens_mistral': 781, 'n_tokens_neox': 714, 'n_words': 133}