<commit_before># Copyright 2011 <NAME>
# This file is part of Marpa::XS.  Marpa::XS is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::XS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser
# General Public License along with Marpa::XS.  If not, see
# http://www.gnu.org/licenses/.

package Marpa::XS;

use 5.010;
use strict;
use warnings;
use Carp;
use English qw( -no_match_vars );

use vars qw(@ISA);
@ISA = qw( DynaLoader );
sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }

use Marpa::XS::Version;

if ( defined $Marpa::PP::VERSION ) {
    Carp::croak('Attempt to load Marpa::XS when Marpa::PP ', $Marpa::PP::VERSION, ' already loaded');
}
if ( $Marpa::USING_PP ) {
    Carp::croak('Attempt to load Marpa::XS when already using Marpa::PP');
}
if ( $Marpa::USING_XS ) {
    die('Internal error: Attempt to load Marpa::XS twice');
}
if ( $Marpa::USE_PP ) {
    Carp::croak('Attempt to load Marpa::XS when USE_PP specified');
}

# Sensible defaults if not defined
$Marpa::USE_XS = 1;
$Marpa::USING_XS = 1;
$Marpa::USING_PP = 0;

require Marpa::PP;
if (!defined $Marpa::PP::VERSION ) {
    die('Internal error: VERSION not defined in Marpa::PP');
}
if ($Marpa::PP::STRING_VERSION ne $Marpa::XS::STRING_VERSION ) {
    Carp::croak("Version mismatch between Marpa::XS and Marpa::PP\n",
    "Marpa::XS is version ", $Marpa::XS::STRING_VERSION, "\n",
    "Marpa::PP is version ", $Marpa::PP::STRING_VERSION, "\n",
    "The Marpa::XS and Marpa::PP versions must match and they do not\n"
    );
}

eval {
    package DynaLoader;
    my @libs = split q{ }, ExtUtils::PkgConfig->libs("glib-2.0");
    @DynaLoader::dl_resolve_using = dl_findfile(@libs);
    bootstrap Marpa::XS $Marpa::XS::STRING_VERSION;
    1;
} or do {
    Carp::croak("Could not load XS version of Marpa: $EVAL_ERROR");
};

my $version_found = join q{.}, Marpa::XS::version();
my $version_wanted = '0.1.0';
Carp::croak('Marpa::XS ', "fails version check, wanted $version_wanted, found $version_found")
    if $version_wanted ne $version_found;

require Marpa::XS::Grammar;
require Marpa::XS::Recognizer;
require Marpa::XS::Value;<commit_msg>Reorg of test files<commit_after># Copyright 2011 <NAME>
# This file is part of Marpa::XS.  Marpa::XS is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::XS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser
# General Public License along with Marpa::XS.  If not, see
# http://www.gnu.org/licenses/.

package Marpa::XS;

use 5.010;
use strict;
use warnings;
use Carp;
use English qw( -no_match_vars );

use vars qw(@ISA);
@ISA = qw( DynaLoader );
sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }

use Marpa::XS::Version;

if ( defined $Marpa::PP::VERSION ) {
    Carp::croak('Attempt to load Marpa::XS when Marpa::PP ', $Marpa::PP::VERSION, ' already loaded');
}
if ( $Marpa::USING_PP ) {
    Carp::croak('Attempt to load Marpa::XS when already using Marpa::PP');
}
if ( $Marpa::USING_XS ) {
    die('Internal error: Attempt to load Marpa::XS twice');
}
if ( $Marpa::USE_PP ) {
    Carp::croak('Attempt to load Marpa::XS when USE_PP specified');
}

# Sensible defaults if not defined
$Marpa::USE_XS = 1;
$Marpa::USING_XS = 1;
$Marpa::USING_PP = 0;

require Marpa::PP;
if (!defined $Marpa::PP::VERSION ) {
    die('Internal error: VERSION not defined in Marpa::PP');
}
if ($Marpa::PP::STRING_VERSION ne $Marpa::XS::STRING_VERSION ) {
    Carp::croak("Version mismatch between Marpa::XS and Marpa::PP\n",
    "Marpa::XS is version ", $Marpa::XS::STRING_VERSION, "\n",
    "Marpa::PP is version ", $Marpa::PP::STRING_VERSION, "\n",
    "The Marpa::XS and Marpa::PP versions must match and they do not\n"
    );
}

eval {
    package DynaLoader;
    my @libs = split q{ }, ExtUtils::PkgConfig->libs("glib-2.0");
    @DynaLoader::dl_resolve_using = dl_findfile(@libs);
    bootstrap Marpa::XS $Marpa::XS::STRING_VERSION;
    1;
} or do {
    Carp::croak("Could not load XS version of Marpa: $EVAL_ERROR");
};

my $version_found = join q{.}, Marpa::XS::version();
my $version_wanted = '0.1.0';
Carp::croak('Marpa::XS ', "fails version check, wanted $version_wanted, found $version_found")
    if $version_wanted ne $version_found;

require Marpa::PP::Slot;
require Marpa::XS::Grammar;
require Marpa::XS::Recognizer;
require Marpa::XS::Value;
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.009380496384600352, 'mean_word_length': 4.674057649667406, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7086637', 'n_tokens_mistral': 1834, 'n_tokens_neox': 1716, 'n_words': 568}