Skip to content
This repository
tree: c5cd4cde3d
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 58 lines (56 sloc) 1.846 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
# Do not edit this file - Generated by Perlito5 9.0
use v5;
use Perlito5::Perl5::Runtime;
package main;
package Perlito5::Grammar::Block;
use Perlito5::Expression;
Perlito5::Expression::add_statement(('{' => sub {
    Perlito5::Grammar::Block->term_block($_[0], $_[1])
}));
Perlito5::Expression::add_statement(('BEGIN' => sub {
    Perlito5::Grammar::Block->term_block($_[0], $_[1])
}));
Perlito5::Expression::add_statement(('UNITCHECK' => sub {
    Perlito5::Grammar::Block->term_block($_[0], $_[1])
}));
Perlito5::Expression::add_statement(('CHECK' => sub {
    Perlito5::Grammar::Block->term_block($_[0], $_[1])
}));
Perlito5::Expression::add_statement(('INIT' => sub {
    Perlito5::Grammar::Block->term_block($_[0], $_[1])
}));
Perlito5::Expression::add_statement(('END' => sub {
    Perlito5::Grammar::Block->term_block($_[0], $_[1])
}));
sub Perlito5::Grammar::Block::term_block {
    ((my $self) = $_[0]);
    ((my $str) = $_[1]);
    ((my $pos) = $_[2]);
    ((my $p) = $pos);
    (my $block_name);
    ((my $m_name) = Perlito5::Grammar->ident($str, $p));
    if ($m_name) {
        ($p = $m_name->{'to'});
        ($block_name = Perlito5::Match::flat($m_name))
    };
    ((my $m) = Perlito5::Grammar::Space->ws($str, $p));
    if ($m) {
        ($p = $m->{'to'})
    };
    if ((substr($str, $p, 1) eq '{')) {
        ((my $m) = Perlito5::Expression->term_curly($str, $p));
        if ($m) {
            ((my $v) = Perlito5::Match::flat($m));
            ($v = Perlito5::AST::Lit::Block->new(('stmts' => $v->[2]), ('sig' => $v->[3])));
            ($v = Perlito5::Expression::block_or_hash($v));
            if ((ref($v) eq 'Perlito5::AST::Lit::Block')) {
                ($v->{'name'} = $block_name);
                ($m->{'capture'} = $v);
                return ($m)
            }
        }
    };
    return (0)
};
1;

1;
Something went wrong with that request. Please try again.