<commit_before>use QRegex;

class NQP::Compiler is HLL::Compiler {
    method optimize($past, *%adverbs) {
        %adverbs<optimize> eq 'off'
            ?? $past
            !! NQP::Optimizer.new.optimize($past, |%adverbs)
    }
}

# Create and configure compiler object.
my $nqpcomp := NQP::Compiler.new();
$nqpcomp.language('nqp');
$nqpcomp.parsegrammar(NQP::Grammar);
$nqpcomp.parseactions(NQP::Actions);
hll-config($nqpcomp.config);

$nqpcomp.addstage('optimize', :after<ast>);

# Add extra command line options.
my @clo := $nqpcomp.commandline_options();
@clo.push('parsetrace');
@clo.push('setting=s');
@clo.push('setting-path=s');
@clo.push('module-path=s');
@clo.push('no-regex-lib');
@clo.push('stable-sc');
#?if parrot
@clo.push('vmlibs=s');
@clo.push('dynext=s');
#?endif
#?if jvm
@clo.push('javaclass=s');
@clo.push('bootstrap');
$nqpcomp.addstage('classname', :after<start>);<commit_msg>allow the user to turn off optimizing for nqp<commit_after>use QRegex;

class NQP::Compiler is HLL::Compiler {
    method optimize($past, *%adverbs) {
        %adverbs<optimize> eq 'off'
            ?? $past
            !! NQP::Optimizer.new.optimize($past, |%adverbs)
    }
}

# Create and configure compiler object.
my $nqpcomp := NQP::Compiler.new();
$nqpcomp.language('nqp');
$nqpcomp.parsegrammar(NQP::Grammar);
$nqpcomp.parseactions(NQP::Actions);
hll-config($nqpcomp.config);

$nqpcomp.addstage('optimize', :after<ast>);

# Add extra command line options.
my @clo := $nqpcomp.commandline_options();
@clo.push('parsetrace');
@clo.push('setting=s');
@clo.push('setting-path=s');
@clo.push('module-path=s');
@clo.push('no-regex-lib');
@clo.push('stable-sc');
@clo.push('optimize=s');
#?if parrot
@clo.push('vmlibs=s');
@clo.push('dynext=s');
#?endif
#?if jvm
@clo.push('javaclass=s');
@clo.push('bootstrap');
$nqpcomp.addstage('classname', :after<start>);
{'fraction_non_alphanumeric': 0.2138635142396561, 'fraction_numerical': 0.0, 'mean_word_length': 5.6263345195729535, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5408117', 'n_tokens_mistral': 765, 'n_tokens_neox': 720, 'n_words': 116}