# Do not edit this file - Generated by Perlito5 9.025

{
    package main;
    package Perlito5::Grammar;
    use strict ;
    use Perlito5::Grammar::Expression ;
    use Perlito5::Grammar::Statement ;
    sub Perlito5::Grammar::unless {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("u" eq $str->[($MATCH->{"to"}) + 0]) && ("n" eq $str->[($MATCH->{"to"}) + 1]) && ("l" eq $str->[($MATCH->{"to"}) + 2]) && ("e" eq $str->[($MATCH->{"to"}) + 3]) && ("s" eq $str->[($MATCH->{"to"}) + 4]) && ("s" eq $str->[($MATCH->{"to"}) + 5]) && ($MATCH->{"to"} += 6)) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (do {
            my $m2 = Perlito5::Grammar::Expression::term_paren($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"Perlito5::Grammar::Expression::term_paren"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $tmp100 = $MATCH->{"to"};
            (((do {
                my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    1
                }
                else {;
                    0
                }
            }) && (("e" eq $str->[($MATCH->{"to"}) + 0]) && ("l" eq $str->[($MATCH->{"to"}) + 1]) && ("s" eq $str->[($MATCH->{"to"}) + 2]) && ("e" eq $str->[($MATCH->{"to"}) + 3]) && ($MATCH->{"to"} += 4)) && (do {
                my $m2 = Perlito5::Grammar::block2($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"block2"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                $MATCH->{"capture"} = Perlito5::AST::If::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::Match::flat($MATCH->{"block2"}), "otherwise", Perlito5::Match::flat($MATCH->{"block"}));
                1
            }))) || ($MATCH->{"to"} = $tmp100, ((do {
                my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    1
                }
                else {;
                    0
                }
            }) && (("e" eq $str->[($MATCH->{"to"}) + 0]) && ("l" eq $str->[($MATCH->{"to"}) + 1]) && ("s" eq $str->[($MATCH->{"to"}) + 2]) && ($MATCH->{"to"} += 3)) && (do {
                my $m2 = Perlito5::Grammar::if_($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"if_"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                $MATCH->{"capture"} = Perlito5::AST::If::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::AST::Block::->new("stmts", [Perlito5::Match::flat($MATCH->{"if_"})]), "otherwise", Perlito5::Match::flat($MATCH->{"block"}));
                1
            }))) || ($MATCH->{"to"} = $tmp100, (do {
                $MATCH->{"capture"} = Perlito5::AST::If::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::AST::Block::->new("stmts", []), "otherwise", Perlito5::Match::flat($MATCH->{"block"}));
                1
            }))
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    sub Perlito5::Grammar::if_ {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("i" eq $str->[($MATCH->{"to"}) + 0]) && ("f" eq $str->[($MATCH->{"to"}) + 1]) && ($MATCH->{"to"} += 2)) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (do {
            my $m2 = Perlito5::Grammar::Expression::term_paren($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"Perlito5::Grammar::Expression::term_paren"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $tmp114 = $MATCH->{"to"};
            (((do {
                my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    1
                }
                else {;
                    0
                }
            }) && (("e" eq $str->[($MATCH->{"to"}) + 0]) && ("l" eq $str->[($MATCH->{"to"}) + 1]) && ("s" eq $str->[($MATCH->{"to"}) + 2]) && ("e" eq $str->[($MATCH->{"to"}) + 3]) && ($MATCH->{"to"} += 4)) && (do {
                my $m2 = Perlito5::Grammar::block2($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"block2"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                $MATCH->{"capture"} = Perlito5::AST::If::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::Match::flat($MATCH->{"block"}), "otherwise", Perlito5::Match::flat($MATCH->{"block2"}));
                1
            }))) || ($MATCH->{"to"} = $tmp114, ((do {
                my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    1
                }
                else {;
                    0
                }
            }) && (("e" eq $str->[($MATCH->{"to"}) + 0]) && ("l" eq $str->[($MATCH->{"to"}) + 1]) && ("s" eq $str->[($MATCH->{"to"}) + 2]) && ($MATCH->{"to"} += 3)) && (do {
                my $m2 = Perlito5::Grammar::if_($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"if_"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                $MATCH->{"capture"} = Perlito5::AST::If::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::Match::flat($MATCH->{"block"}), "otherwise", Perlito5::AST::Block::->new("stmts", [Perlito5::Match::flat($MATCH->{"if_"})]));
                1
            }))) || ($MATCH->{"to"} = $tmp114, (do {
                $MATCH->{"capture"} = Perlito5::AST::If::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::Match::flat($MATCH->{"block"}), "otherwise", Perlito5::AST::Block::->new("stmts", []));
                1
            }))
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    sub Perlito5::Grammar::when {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("w" eq $str->[($MATCH->{"to"}) + 0]) && ("h" eq $str->[($MATCH->{"to"}) + 1]) && ("e" eq $str->[($MATCH->{"to"}) + 2]) && ("n" eq $str->[($MATCH->{"to"}) + 3]) && ($MATCH->{"to"} += 4)) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (do {
            my $m2 = Perlito5::Grammar::Expression::term_paren($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"Perlito5::Grammar::Expression::term_paren"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            $MATCH->{"capture"} = Perlito5::AST::When::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_paren"})->[2], "body", Perlito5::Match::flat($MATCH->{"block"}));
            1
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    sub Perlito5::Grammar::is_bareword {
        my $term = shift;
        (ref($term) eq "Perlito5::AST::Apply") and $term->{"bareword"}
    }
    sub Perlito5::Grammar::for {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("f" eq $str->[($MATCH->{"to"}) + 0]) && ("o" eq $str->[($MATCH->{"to"}) + 1]) && ("r" eq $str->[($MATCH->{"to"}) + 2]) && ($MATCH->{"to"} += 3)) && (do {
            my $m = $MATCH;
            if (!(("e" eq $str->[($MATCH->{"to"}) + 0]) && ("a" eq $str->[($MATCH->{"to"}) + 1]) && ("c" eq $str->[($MATCH->{"to"}) + 2]) && ("h" eq $str->[($MATCH->{"to"}) + 3]) && ($MATCH->{"to"} += 4))) {;
                $MATCH = $m
            }
            1
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (do {
            my $tmp137 = $MATCH->{"to"};
            (((do {
                my $tmp138 = $MATCH->{"to"};
                (((do {
                    my $m2 = Perlito5::Grammar::Space::ws($str, $MATCH->{"to"});
                    if ($m2) {
                        $MATCH->{"to"} = $m2->{"to"};
                        1
                    }
                    else {;
                        0
                    }
                }) && (do {
                    my $m2 = Perlito5::Grammar::Expression::term_declarator($str, $MATCH->{"to"});
                    if ($m2) {
                        $MATCH->{"to"} = $m2->{"to"};
                        $MATCH->{"Perlito5::Grammar::Expression::term_declarator"} = $m2;
                        1
                    }
                    else {;
                        0
                    }
                }) && (do {
                    $MATCH->{"_tmp"} = Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::term_declarator"})->[1];
                    1
                }))) || ($MATCH->{"to"} = $tmp138, ((do {
                    my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                    if ($m2) {
                        $MATCH->{"to"} = $m2->{"to"};
                        1
                    }
                    else {;
                        0
                    }
                }) && (do {
                    my $tmp = $MATCH;
                    $MATCH = {"from" => $tmp->{"to"}, "to" => $tmp->{"to"}, };
                    my $res = (("\$" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1));
                    $MATCH = $tmp;
                    $res ? 1 : 0
                }) && (do {
                    my $m2 = Perlito5::Grammar::Sigil::term_sigil($str, $MATCH->{"to"});
                    if ($m2) {
                        $MATCH->{"to"} = $m2->{"to"};
                        $MATCH->{"Perlito5::Grammar::Sigil::term_sigil"} = $m2;
                        1
                    }
                    else {;
                        0
                    }
                }) && (do {
                    $MATCH->{"_tmp"} = Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Sigil::term_sigil"})->[1];
                    my $v = $MATCH->{"_tmp"};
                    my $look = Perlito5::Grammar::Scope::lookup_variable($v);
                    my $decl = $look && $look->{"_decl"} ? $look->{"_decl"} : "global";
                    if ($decl ne "global") {
                        $v->{"_id"} = $Perlito5::ID++;
                        $v->{"_decl"} = $decl;
                        $MATCH->{"_tmp"} = Perlito5::AST::Decl::->new("decl", $decl, "var", $v)
                    }
                    1
                })))
            }) && (do {
                my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    1
                }
                else {;
                    0
                }
            }) && (("(" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
                my $m2 = Perlito5::Grammar::Expression::paren_parse($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"Perlito5::Grammar::Expression::paren_parse"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && ((")" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
                my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"block"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                my $m2 = Perlito5::Grammar::opt_continue_block($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"opt_continue_block"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                my $body = Perlito5::Match::flat($MATCH->{"block"});
                my $header = Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::paren_parse"});
                my $topic = $MATCH->{"_tmp"};
                my $continue_block = $MATCH->{"opt_continue_block"}->{"capture"};
                $MATCH->{"capture"} = Perlito5::AST::For::->new("cond", $header, "body", $body, "continue", $continue_block, "topic", $topic);
                1
            }))) || ($MATCH->{"to"} = $tmp137, ((do {
                my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    1
                }
                else {;
                    0
                }
            }) && (("(" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
                my $tmp139 = $MATCH->{"to"};
                (((do {
                    my $m2 = Perlito5::Grammar::Expression::exp_parse($str, $MATCH->{"to"});
                    if ($m2) {
                        $MATCH->{"to"} = $m2->{"to"};
                        $MATCH->{"Perlito5::Grammar::Expression::exp_parse"} = $m2;
                        1
                    }
                    else {;
                        0
                    }
                }) && (do {
                    Perlito5::Grammar::Scope::check_variable_declarations();
                    1
                }))) || ($MATCH->{"to"} = $tmp139, ()) || ($MATCH->{"to"} = $tmp139, ((do {
                    my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                    if ($m2) {
                        $MATCH->{"to"} = $m2->{"to"};
                        1
                    }
                    else {;
                        0
                    }
                }) && (do {
                    my $tmp = $MATCH;
                    $MATCH = {"from" => $tmp->{"to"}, "to" => $tmp->{"to"}, };
                    my $res = ((";" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1));
                    $MATCH = $tmp;
                    $res ? 1 : 0
                })))
            }) && (do {
                my $tmp140 = $MATCH->{"to"};
                ((((";" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
                    $MATCH->{"c_style_for"} = 1;
                    1
                }) && (do {
                    my $tmp141 = $MATCH->{"to"};
                    (((do {
                        my $m2 = Perlito5::Grammar::exp($str, $MATCH->{"to"});
                        if ($m2) {
                            $MATCH->{"to"} = $m2->{"to"};
                            $MATCH->{"Perlito5::Grammar::exp"} = $m2;
                            1
                        }
                        else {;
                            0
                        }
                    }) && (do {
                        Perlito5::Grammar::Scope::check_variable_declarations();
                        1
                    }))) || ($MATCH->{"to"} = $tmp141, ()) || ($MATCH->{"to"} = $tmp141, (do {
                        my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                        if ($m2) {
                            $MATCH->{"to"} = $m2->{"to"};
                            1
                        }
                        else {;
                            0
                        }
                    }))
                }) && ((";" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
                    my $tmp142 = $MATCH->{"to"};
                    ((do {
                        my $m2 = Perlito5::Grammar::exp2($str, $MATCH->{"to"});
                        if ($m2) {
                            $MATCH->{"to"} = $m2->{"to"};
                            $MATCH->{"Perlito5::Grammar::exp2"} = $m2;
                            1
                        }
                        else {;
                            0
                        }
                    })) || ($MATCH->{"to"} = $tmp142, ()) || ($MATCH->{"to"} = $tmp142, (do {
                        my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
                        if ($m2) {
                            $MATCH->{"to"} = $m2->{"to"};
                            1
                        }
                        else {;
                            0
                        }
                    }))
                }))) || ($MATCH->{"to"} = $tmp140, 1)
            }) && ((")" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
                my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"block"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                my $m2 = Perlito5::Grammar::opt_continue_block($str, $MATCH->{"to"});
                if ($m2) {
                    $MATCH->{"to"} = $m2->{"to"};
                    $MATCH->{"opt_continue_block"} = $m2;
                    1
                }
                else {;
                    0
                }
            }) && (do {
                my $header;
                my $body = Perlito5::Match::flat($MATCH->{"block"});
                my $topic;
                my $continue_block = $MATCH->{"opt_continue_block"}->{"capture"};
                if ($MATCH->{"c_style_for"}) {;
                    $header = [$MATCH->{"Perlito5::Grammar::Expression::exp_parse"}->{"capture"}, $MATCH->{"Perlito5::Grammar::exp"}->{"capture"}, $MATCH->{"Perlito5::Grammar::exp2"}->{"capture"}]
                }
                else {
                    $header = $MATCH->{"Perlito5::Grammar::Expression::exp_parse"}->{"capture"};
                    $topic = Perlito5::AST::Var::SCALAR_ARG()
                }
                $MATCH->{"capture"} = Perlito5::AST::For::->new("cond", $header, "body", $body, "continue", $continue_block, "topic", $topic);
                1
            })))
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    sub Perlito5::Grammar::while {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("w" eq $str->[($MATCH->{"to"}) + 0]) && ("h" eq $str->[($MATCH->{"to"}) + 1]) && ("i" eq $str->[($MATCH->{"to"}) + 2]) && ("l" eq $str->[($MATCH->{"to"}) + 3]) && ("e" eq $str->[($MATCH->{"to"}) + 4]) && ($MATCH->{"to"} += 5)) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (("(" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
            my $m2 = Perlito5::Grammar::Expression::paren_parse($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"Perlito5::Grammar::Expression::paren_parse"} = $m2;
                1
            }
            else {;
                0
            }
        }) && ((")" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
            my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::opt_continue_block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"opt_continue_block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $cond = Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::paren_parse"});
            if ($cond eq "*undef*") {;
                $cond = Perlito5::AST::Int::->new("int", 1)
            }
            my $stmt = Perlito5::AST::While::->new("cond", Perlito5::FoldConstant::fold_constant($cond), "body", Perlito5::Match::flat($MATCH->{"block"}), "continue", $MATCH->{"opt_continue_block"}->{"capture"});
            my $out = Perlito5::Macro::while_file($stmt);
            $out && ($stmt = $out);
            $MATCH->{"capture"} = $stmt;
            1
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    sub Perlito5::Grammar::until {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("u" eq $str->[($MATCH->{"to"}) + 0]) && ("n" eq $str->[($MATCH->{"to"}) + 1]) && ("t" eq $str->[($MATCH->{"to"}) + 2]) && ("i" eq $str->[($MATCH->{"to"}) + 3]) && ("l" eq $str->[($MATCH->{"to"}) + 4]) && ($MATCH->{"to"} += 5)) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (("(" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
            my $m2 = Perlito5::Grammar::Expression::paren_parse($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"Perlito5::Grammar::Expression::paren_parse"} = $m2;
                1
            }
            else {;
                0
            }
        }) && ((")" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
            my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $m2 = Perlito5::Grammar::opt_continue_block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"opt_continue_block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $cond = Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::paren_parse"});
            if ($cond eq "*undef*") {;
                $cond = Perlito5::AST::Int::->new("int", 1)
            }
            $MATCH->{"capture"} = Perlito5::AST::While::->new("cond", Perlito5::FoldConstant::fold_constant(Perlito5::AST::Apply::->new("arguments", [$cond], "code", "prefix:<!>", "namespace", '')), "body", Perlito5::Match::flat($MATCH->{"block"}), "continue", $MATCH->{"opt_continue_block"}->{"capture"});
            1
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    sub Perlito5::Grammar::given {
        my $str = $_[0];
        my $pos = $_[1];
        my $MATCH = {"str" => $str, "from" => $pos, "to" => $pos, };
        my $tmp = (((("g" eq $str->[($MATCH->{"to"}) + 0]) && ("i" eq $str->[($MATCH->{"to"}) + 1]) && ("v" eq $str->[($MATCH->{"to"}) + 2]) && ("e" eq $str->[($MATCH->{"to"}) + 3]) && ("n" eq $str->[($MATCH->{"to"}) + 4]) && ($MATCH->{"to"} += 5)) && (do {
            my $m2 = Perlito5::Grammar::Space::opt_ws($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                1
            }
            else {;
                0
            }
        }) && (do {
            Perlito5::Grammar::Scope::create_new_compile_time_scope();
            1
        }) && (("(" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
            my $m2 = Perlito5::Grammar::Expression::paren_parse($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"Perlito5::Grammar::Expression::paren_parse"} = $m2;
                1
            }
            else {;
                0
            }
        }) && ((")" eq $str->[($MATCH->{"to"}) + 0]) && ($MATCH->{"to"} += 1)) && (do {
            my $m2 = Perlito5::Grammar::block($str, $MATCH->{"to"});
            if ($m2) {
                $MATCH->{"to"} = $m2->{"to"};
                $MATCH->{"block"} = $m2;
                1
            }
            else {;
                0
            }
        }) && (do {
            my $body = Perlito5::Match::flat($MATCH->{"block"});
            $body->{"sig"} = Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::var_ident"});
            $MATCH->{"capture"} = Perlito5::AST::Given::->new("cond", Perlito5::Match::flat($MATCH->{"Perlito5::Grammar::Expression::paren_parse"}), "body", $body);
            1
        }) && (do {
            Perlito5::Grammar::Scope::end_compile_time_scope();
            1
        })));
        $tmp ? $MATCH : undef
    }
    Perlito5::Grammar::Statement::add_statement("if", \&if_);
    Perlito5::Grammar::Statement::add_statement("for", \&for);
    Perlito5::Grammar::Statement::add_statement("foreach", \&for);
    Perlito5::Grammar::Statement::add_statement("when", \&when);
    Perlito5::Grammar::Statement::add_statement("while", \&while);
    Perlito5::Grammar::Statement::add_statement("until", \&until);
    Perlito5::Grammar::Statement::add_statement("given", \&given);
    Perlito5::Grammar::Statement::add_statement("unless", \&unless)
}
;1
