Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c5cd4cde3d
Fetching contributors…

Cannot retrieve contributors at this time

927 lines (925 sloc) 27.722 kb
# Do not edit this file - Generated by Perlito5 9.0
use v5;
use Perlito5::Perl5::Runtime;
package main;
package Perlito5::Grammar::Regex;
use Perlito5::Precedence;
sub Perlito5::Grammar::Regex::token {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
(((((((do {
((my $m2) = Perlito5::Grammar->ident($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar.ident'} = $m2);
1
}
else {
0
}
})) && ((do {
((my $m2) = Perlito5::Grammar::Space->opt_ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((('{' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
((my $m2) = Perlito5::Grammar::Regex->rule($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar::Regex.rule'} = $m2);
1
}
else {
0
}
}))) && ((('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
((my $source) = (Perlito5::Match::flat($MATCH->{'Perlito5::Grammar.ident'}) . '{ ' . 'my $grammar = $_[0]; ' . 'my $str = $_[1]; ' . 'my $pos = $_[2]; ' . 'my $MATCH = { str => $str, from => $pos, to => $pos }; ' . 'my $tmp = ( ' . Perlito5::Match::flat($MATCH->{'Perlito5::Grammar::Regex.rule'})->emit_perl5() . '); ' . '$tmp ? $MATCH : 0; ' . '}'));
((my $ast) = Perlito5::Grammar->named_sub_def($source, 0));
($MATCH->{'capture'} = Perlito5::Match::flat($ast));
;
1
})))
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::term_token {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
(((((('token' eq substr($str, $MATCH->{'to'}, 5)) && (($MATCH->{'to'} = (5 + $MATCH->{'to'}))))) && ((do {
((my $m2) = Perlito5::Grammar::Space->ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((do {
((my $m2) = $grammar->token($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'token'} = $m2);
1
}
else {
0
}
}))) && ((do {
($MATCH->{'capture'} = ['term', Perlito5::Match::flat($MATCH->{'token'})]);
1
})))
}))
}))));
($tmp ? $MATCH : 0)
};
Perlito5::Precedence::add_term('token', sub {
Perlito5::Grammar::Regex->term_token($_[0], $_[1])
});
sub Perlito5::Grammar::Regex::any {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
(('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::literal {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
((my $last_match_null) = 0);
((my $m) = $MATCH);
((my $to) = $MATCH->{'to'});
for ( ; (((do {
((my $pos1) = $MATCH->{'to'});
(((do {
((((chr(92) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
})) || ((do {
($MATCH->{'to'} = $pos1);
((((do {
((my $tmp) = $MATCH);
($MATCH = {('str' => $str), ('from' => $tmp->{'to'}), ('to' => $tmp->{'to'})});
((my $res) = ((do {
((my $pos1) = $MATCH->{'to'});
((do {
((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
}))
})));
($MATCH = ($res ? 0 : $tmp))
})) && ((('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
})))
})) && (($last_match_null < 2))); ) {
if (($to == $MATCH->{'to'})) {
($last_match_null = ($last_match_null + 1))
}
else {
($last_match_null = 0)
};
($m = $MATCH);
($to = $MATCH->{'to'})
};
($MATCH = $m);
($MATCH->{'to'} = $to);
1
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::metasyntax_exp {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
((my $last_match_null) = 0);
((my $m) = $MATCH);
((my $to) = $MATCH->{'to'});
((my $count) = 0);
for ( ; (((do {
((my $pos1) = $MATCH->{'to'});
((((((do {
((((chr(92) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
})) || ((do {
($MATCH->{'to'} = $pos1);
((((((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->literal($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && (((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((((('{' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->string_code($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((((('<' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->metasyntax_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((do {
((my $tmp) = $MATCH);
($MATCH = {('str' => $str), ('from' => $tmp->{'to'}), ('to' => $tmp->{'to'})});
((my $res) = ((do {
((my $pos1) = $MATCH->{'to'});
((do {
(('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
}))
})));
($MATCH = ($res ? 0 : $tmp))
})) && ((('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
})))
})) && (($last_match_null < 2))); ) {
if (($to == $MATCH->{'to'})) {
($last_match_null = ($last_match_null + 1))
}
else {
($last_match_null = 0)
};
($m = $MATCH);
($to = $MATCH->{'to'});
($count = ($count + 1))
};
($MATCH = $m);
($MATCH->{'to'} = $to);
($count > 0)
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::string_code {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
((my $last_match_null) = 0);
((my $m) = $MATCH);
((my $to) = $MATCH->{'to'});
((my $count) = 0);
for ( ; (((do {
((my $pos1) = $MATCH->{'to'});
(((((do {
((((chr(92) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
})) || ((do {
($MATCH->{'to'} = $pos1);
((((((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->literal($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && (((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((((('{' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->string_code($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((do {
((my $tmp) = $MATCH);
($MATCH = {('str' => $str), ('from' => $tmp->{'to'}), ('to' => $tmp->{'to'})});
((my $res) = ((do {
((my $pos1) = $MATCH->{'to'});
((do {
(('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
}))
})));
($MATCH = ($res ? 0 : $tmp))
})) && ((('' ne substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))))
})))
})) && (($last_match_null < 2))); ) {
if (($to == $MATCH->{'to'})) {
($last_match_null = ($last_match_null + 1))
}
else {
($last_match_null = 0)
};
($m = $MATCH);
($to = $MATCH->{'to'});
($count = ($count + 1))
};
($MATCH = $m);
($MATCH->{'to'} = $to);
($count > 0)
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::parsed_code {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
(((do {
((my $m2) = $grammar->string_code($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
})) && ((do {
($MATCH->{'capture'} = Perlito5::Match::flat($MATCH));
1
})))
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::rule_terms {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
(((((((((do {
((((((('<before' eq substr($str, $MATCH->{'to'}, 7)) && (($MATCH->{'to'} = (7 + $MATCH->{'to'}))))) && ((do {
((my $m2) = Perlito5::Grammar::Space->ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((do {
((my $m2) = $grammar->rule($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'rule'} = $m2);
1
}
else {
0
}
}))) && ((('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::Before->new(('rule_exp' => Perlito5::Match::flat($MATCH->{'rule'}))));
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((((((('<!before' eq substr($str, $MATCH->{'to'}, 8)) && (($MATCH->{'to'} = (8 + $MATCH->{'to'}))))) && ((do {
((my $m2) = Perlito5::Grammar::Space->ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
}))) && ((do {
((my $m2) = $grammar->rule($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'rule'} = $m2);
1
}
else {
0
}
}))) && ((('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::NotBefore->new(('rule_exp' => Perlito5::Match::flat($MATCH->{'rule'}))));
1
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((((((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->literal($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'literal'} = $m2);
1
}
else {
0
}
}))) && (((chr(39) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::Constant->new(('constant' => Perlito5::Match::flat($MATCH->{'literal'}))));
1
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((('<' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((((('.' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->metasyntax_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'metasyntax_exp'} = $m2);
1
}
else {
0
}
}))) && ((('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::Perlito5::AST::Subrule->new(('metasyntax' => Perlito5::Match::flat($MATCH->{'metasyntax_exp'})), ('captures' => 0)));
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((((do {
((my $m2) = $grammar->metasyntax_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'metasyntax_exp'} = $m2);
1
}
else {
0
}
})) && ((('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::Perlito5::AST::Subrule->new(('metasyntax' => Perlito5::Match::flat($MATCH->{'metasyntax_exp'})), ('captures' => 1)));
1
}))))
})))
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((((('{' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->parsed_code($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'parsed_code'} = $m2);
1
}
else {
0
}
}))) && ((('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::Block->new(('closure' => Perlito5::Match::flat($MATCH->{'parsed_code'}))));
1
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((((chr(92) eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $pos1) = $MATCH->{'to'});
((((do {
((((((('c' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((('[' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
((my $m2) = Perlito5::Grammar->digits($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar.digits'} = $m2);
1
}
else {
0
}
}))) && (((']' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Rul::Constant->new(('constant' => chr(Perlito5::Match::flat($MATCH->{'Perlito5::Grammar.digits'})))));
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((((('c' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = Perlito5::Grammar->digits($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar.digits'} = $m2);
1
}
else {
0
}
}))) && ((do {
($MATCH->{'capture'} = Rul::Constant->new(('constant' => chr(Perlito5::Match::flat($MATCH->{'Perlito5::Grammar.digits'})))));
1
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((do {
((my $m2) = $grammar->any($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'any'} = $m2);
1
}
else {
0
}
})) && ((do {
($MATCH->{'capture'} = Rul::SpecialChar->new(('char' => Perlito5::Match::flat($MATCH->{'any'}))));
1
}))))
})))
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((('.' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
($MATCH->{'capture'} = Rul::Perlito5::AST::Dot->new());
1
}))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((((('[' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->rule($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'rule'} = $m2);
1
}
else {
0
}
}))) && (((']' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
($MATCH->{'capture'} = Perlito5::Match::flat($MATCH->{'rule'}));
1
}))))
})))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::rule_term {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((do {
((my $m2) = $grammar->rule_terms($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'rule_terms'} = $m2);
1
}
else {
0
}
})) && ((do {
($MATCH->{'capture'} = Perlito5::Match::flat($MATCH->{'rule_terms'}));
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((((do {
((my $tmp) = $MATCH);
($MATCH = {('str' => $str), ('from' => $tmp->{'to'}), ('to' => $tmp->{'to'})});
((my $res) = ((do {
((my $pos1) = $MATCH->{'to'});
((((((((((((do {
((']' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((')' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('>' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
((((':' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('?' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('+' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('*' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('|' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('&' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('/' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
})))
})));
($MATCH = ($res ? 0 : $tmp))
})) && ((do {
((my $m2) = $grammar->any($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'any'} = $m2);
1
}
else {
0
}
}))) && ((do {
($MATCH->{'capture'} = Rul::Constant->new(('constant' => Perlito5::Match::flat($MATCH->{'any'}))));
1
}))))
})))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::quant_exp {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((((do {
(('?' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((('*' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(((('+' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
})))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::greedy_exp {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((((do {
(('?' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((('+' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
}))) || ((do {
($MATCH->{'to'} = $pos1);
(1)
})))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::quantifier {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
(((((do {
((my $m2) = Perlito5::Grammar::Space->opt_ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar::Space.opt_ws'} = $m2);
1
}
else {
0
}
})) && ((do {
((my $m2) = $grammar->rule_term($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'rule_term'} = $m2);
1
}
else {
0
}
}))) && ((do {
((my $m2) = Perlito5::Grammar::Space->opt_ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar::Space.opt_ws'} = $m2);
1
}
else {
0
}
}))) && ((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((((do {
((my $m2) = $grammar->quant_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'quant_exp'} = $m2);
1
}
else {
0
}
})) && ((do {
((my $m2) = $grammar->greedy_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'greedy_exp'} = $m2);
1
}
else {
0
}
}))) && ((do {
((my $m2) = Perlito5::Grammar::Space->opt_ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'Perlito5::Grammar::Space.opt_ws'} = $m2);
1
}
else {
0
}
}))) && ((do {
($MATCH->{'capture'} = Rul::Quantifier->new(('term' => Perlito5::Match::flat($MATCH->{'rule_term'})), ('quant' => Perlito5::Match::flat($MATCH->{'quant_exp'})), ('greedy' => Perlito5::Match::flat($MATCH->{'greedy_exp'}))));
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((do {
($MATCH->{'capture'} = Perlito5::Match::flat($MATCH->{'rule_term'}));
1
})))
})))
})))
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::concat_list {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((do {
((my $m2) = $grammar->quantifier($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'quantifier'} = $m2);
1
}
else {
0
}
})) && ((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((do {
((my $m2) = $grammar->concat_list($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'concat_list'} = $m2);
1
}
else {
0
}
})) && ((do {
($MATCH->{'capture'} = [Perlito5::Match::flat($MATCH->{'quantifier'}), @{Perlito5::Match::flat($MATCH->{'concat_list'})}]);
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((do {
($MATCH->{'capture'} = [Perlito5::Match::flat($MATCH->{'quantifier'})]);
1
})))
})))
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((do {
($MATCH->{'capture'} = []);
1
})))
})))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::concat_exp {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
(((do {
((my $m2) = $grammar->concat_list($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'concat_list'} = $m2);
1
}
else {
0
}
})) && ((do {
($MATCH->{'capture'} = Rul::Concat->new(('concat' => Perlito5::Match::flat($MATCH->{'concat_list'}))));
1
})))
}))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::or_list_exp {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((do {
((my $m2) = $grammar->concat_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'concat_exp'} = $m2);
1
}
else {
0
}
})) && ((do {
((my $pos1) = $MATCH->{'to'});
(((do {
((((('|' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))) && ((do {
((my $m2) = $grammar->or_list_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'or_list_exp'} = $m2);
1
}
else {
0
}
}))) && ((do {
($MATCH->{'capture'} = [Perlito5::Match::flat($MATCH->{'concat_exp'}), @{Perlito5::Match::flat($MATCH->{'or_list_exp'})}]);
1
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((do {
($MATCH->{'capture'} = [Perlito5::Match::flat($MATCH->{'concat_exp'})]);
1
})))
})))
})))
})) || ((do {
($MATCH->{'to'} = $pos1);
(((do {
($MATCH->{'capture'} = []);
1
})))
})))
}))));
($tmp ? $MATCH : 0)
};
sub Perlito5::Grammar::Regex::rule {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
((my $pos) = $_[2]);
((my $MATCH) = {('str' => $str), ('from' => $pos), ('to' => $pos)});
((my $tmp) = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
((((do {
((my $pos1) = $MATCH->{'to'});
(((do {
(((do {
((my $m) = $MATCH);
if (!(((do {
((my $m2) = Perlito5::Grammar::Space->ws($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
1
}
else {
0
}
})))) {
($MATCH = $m)
};
1
})) && ((('|' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))))
})) || ((do {
($MATCH->{'to'} = $pos1);
(1)
})))
})) && ((do {
((my $m2) = $grammar->or_list_exp($str, $MATCH->{'to'}));
if ($m2) {
($MATCH->{'to'} = $m2->{'to'});
($MATCH->{'or_list_exp'} = $m2);
1
}
else {
0
}
}))) && ((do {
($MATCH->{'capture'} = Rul::Or->new(('or_list' => Perlito5::Match::flat($MATCH->{'or_list_exp'}))));
1
})))
}))
}))));
($tmp ? $MATCH : 0)
};
1;
Jump to Line
Something went wrong with that request. Please try again.