Regexp-Grammars

 view release on metacpan or  search on metacpan

t/error.t  view on Meta::CPAN

            <!!!>

        <token: Literal>
            <error:>
        |
            <MATCH=( [+-]? \d++ (?: \. \d++ )?+ )>

    }xms
};

local $/ = "";
while (my $input = <DATA>) {
    chomp $input;
    my ($text, $expected) = split /\s+/, $input, 2;
    if ($text =~ $calculator) {
        is $/{Answer}, $expected => "Input $.: $text"; 
    }
    else {
        is_deeply \@!, eval($expected), => "Input $.: $text";
    }
}

t/error_non_backtracking.t  view on Meta::CPAN

            <!!!>

        <token: Literal>
            <error:>
        |
            <MATCH=( [+-]? \d++ (?: \. \d++ )?+ )>

    }xms
};

local $/ = "";
while (my $input = <DATA>) {
    chomp $input;
    my ($text, $expected) = split /\s+/, $input, 2;
    if ($text =~ $calculator) {
        is $/{Answer}, $expected => "Input $.: $text"; 
    }
    else {
        is_deeply \@!, eval($expected), => "Input $.: $text";
    }
}

t/error_translate.t  view on Meta::CPAN

            <...>

        <token: Literal>
            <error:>
        |
            <MATCH=( [+-]? \d++ (?: \. \d++ )?+ )>

    }xms
};

local $/ = "";
{
    my $temp = Regexp::Grammars::set_error_translator(\&translator);
    while (my $input = <DATA>) {
        chomp $input;
        my ($text, $expected) = split /\s+/, $input, 2;
        if ($text =~ $calculator) {
            is $/{Answer}, $expected => "Input $.: $text"; 
        }
        else {
            is_deeply \@!, eval($expected), => "Input $.: $text";



( run in 0.271 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )