— |
our $VERSION = '0.50' ;
declare(
'PositiveNum' ,
parent => t( 'Num' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s > 0
)
EOF
},
);
declare(
'PositiveOrZeroNum' ,
parent => t( 'Num' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s >= 0
)
EOF
},
);
declare(
'PositiveInt' ,
parent => t( 'Int' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s > 0
)
EOF
},
);
declare(
'PositiveOrZeroInt' ,
parent => t( 'Int' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s >= 0
)
EOF
},
);
declare(
'NegativeNum' ,
parent => t( 'Num' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s < 0
)
EOF
},
);
declare(
'NegativeOrZeroNum' ,
parent => t( 'Num' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s <= 0
)
EOF
},
);
declare(
'NegativeInt' ,
parent => t( 'Int' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s < 0
)
EOF
},
);
declare(
'NegativeOrZeroInt' ,
parent => t( 'Int' ),
inline => sub {
return
sprintf ( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] );
(
%s
&&
%s <= 0
)
EOF
},
);
declare(
'SingleDigit' ,
parent => t( 'Int' ),
inline => sub {
return
sprintf (
<<'EOF', $_[0]->parent->inline_check( $_[1] ), ( $_[1] ) x 2 );
(
%s
&&
%s >= -9
&&
%s <= 9
)
EOF
},
);
1;
|