"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/lib/RPerl/Test/TypeCheckingOn/AllTypes.pm" (30 Aug 2019, 8618 Bytes) of package /linux/misc/RPerl-5.002000.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 # [[[ PREPROCESSOR ]]]
    2 # <<< TYPE_CHECKING: ON >>>
    3 
    4 # the following subroutines are automatically called when 1 or more of the subroutines in this file are called:
    5 
    6 # integer_CHECK()
    7 # number_CHECK()
    8 # string_CHECK()
    9 
   10 # arrayref_CHECK()
   11 # integer_arrayref_CHECK()
   12 # number_arrayref_CHECK()
   13 # string_arrayref_CHECK()
   14 
   15 # hashref_CHECK()
   16 # hashentry_CHECK()  [NOT A DATA TYPE]
   17 # integer_hashref_CHECK()
   18 # number_hashref_CHECK()
   19 # string_hashref_CHECK()
   20 
   21 # [[[ HEADER ]]]
   22 use RPerl;
   23 package RPerl::Test::TypeCheckingOn::AllTypes;
   24 use strict;
   25 use warnings;
   26 our $VERSION = 0.005_000;
   27 
   28 # [[[ OO INHERITANCE ]]]
   29 use parent qw(RPerl::Test);
   30 use RPerl::Test;
   31 
   32 # [[[ CRITICS ]]]
   33 ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls)  # USER DEFAULT 1: allow numeric values & print operator
   34 ## no critic qw(RequireInterpolationOfMetachars)  # USER DEFAULT 2: allow single-quoted control characters & sigils
   35 ## no critic qw(ProhibitAutomaticExportation)  # SYSTEM SPECIAL 14: allow global exports from Config.pm & elsewhere
   36 
   37 # [[[ EXPORTS ]]]
   38 use RPerl::Exporter qw(import);
   39 our @EXPORT = qw(check_integer check_number check_string check_arrayref check_integer_arrayref check_number_arrayref check_number_arrayrefs check_string_arrayref check_hashref check_integer_hashref check_number_hashref check_number_hashrefs check_string_hashref check__mixed_00 check__mixed_01 check__mixed_02 check__mixed_03);
   40 
   41 # [[[ OO PROPERTIES ]]]
   42 our hashref $properties = {};
   43 
   44 # [[[ OO METHODS ]]]
   45 
   46 sub check_class {
   47     { my void::method $RETURN_TYPE };
   48     ( my RPerl::Test::TypeCheckingOn::AllTypes $self ) = @ARG;
   49 
   50 #    RPerl::diag('in check_class(), received $self =', "\n", Dumper($self), "\n");
   51     return;
   52 }
   53 
   54 sub check_class_integer {
   55     { my void::method $RETURN_TYPE };
   56     ( my RPerl::Test::TypeCheckingOn::AllTypes $self, my integer $input_1 ) = @ARG;
   57 
   58 #    RPerl::diag('in check_class_integer(), received $self =', "\n", Dumper($self), "\n");
   59 #    RPerl::diag('in check_class_integer(), received $input_1 = ', $input_1, "\n");
   60     return;
   61 }
   62 
   63 # [[[ SUBROUTINES ]]]
   64 
   65 # [[ SCALARS ]]
   66 
   67 sub check_integer {
   68     { my void $RETURN_TYPE };
   69     ( my integer $input_1) = @ARG;
   70 
   71 #    RPerl::diag("in check_integer(), received \$input_1\n" . Dumper($input_1) . "\n");
   72     return;
   73 }
   74 
   75 sub check_number {
   76     { my void $RETURN_TYPE };
   77     ( my number $input_1) = @ARG;
   78 
   79 #    RPerl::diag("in check_number(), received \$input_1\n" . Dumper($input_1) . "\n");
   80     return;
   81 }
   82 
   83 sub check_string {
   84     { my void $RETURN_TYPE };
   85     ( my string $input_1) = @ARG;
   86 
   87 #    RPerl::diag("in check_string(), received \$input_1\n" . Dumper($input_1) . "\n");
   88     return;
   89 }
   90 
   91 # [[ ARRAY REFS ]]
   92 
   93 sub check_arrayref {
   94     { my void $RETURN_TYPE };
   95     ( my arrayref $input_1) = @ARG;
   96 
   97 #    RPerl::diag("in check_arrayref(), received \$input_1\n" . Dumper($input_1) . "\n");
   98     return;
   99 }
  100 
  101 sub check_integer_arrayref {
  102     { my void $RETURN_TYPE };
  103     ( my integer_arrayref $input_1) = @ARG;
  104 
  105 #    RPerl::diag("in check_integer_arrayref(), received \$input_1\n" . Dumper($input_1) . "\n");
  106     return;
  107 }
  108 
  109 sub check_number_arrayref {
  110     { my void $RETURN_TYPE };
  111     ( my number_arrayref $input_1) = @ARG;
  112 
  113 #    RPerl::diag("in check_number_arrayref(), received \$input_1\n" . Dumper($input_1) . "\n");
  114     return;
  115 }
  116 
  117 sub check_number_arrayrefs {
  118     { my void $RETURN_TYPE };
  119     (   my number_arrayref $input_1,
  120         my number_arrayref $input_2,
  121         my number_arrayref $input_3)
  122         = @ARG;
  123 
  124 #    RPerl::diag("in check_number_arrayrefs(), received \$input_1\n" . Dumper($input_1) . "\n");
  125 #    RPerl::diag("in check_number_arrayrefs(), received \$input_2\n" . Dumper($input_2) . "\n");
  126 #    RPerl::diag("in check_number_arrayrefs(), received \$input_3\n" . Dumper($input_3) . "\n");
  127 
  128 # DEPRECATED: type checking automated via <<< TYPE_CHECKING: CHECK(TRACE) >>> preprocessor directive
  129 #    ::number_arrayref_CHECK($input_1);
  130 #    ::number_arrayref_CHECK($input_2);
  131 #    ::number_arrayref_CHECK($input_3);
  132     return;
  133 }
  134 
  135 sub check_string_arrayref {
  136     { my void $RETURN_TYPE };
  137     ( my string_arrayref $input_1) = @ARG;
  138 
  139 #    RPerl::diag("in check_string_arrayref(), received \$input_1\n" . Dumper($input_1) . "\n");
  140     return;
  141 }
  142 
  143 # [[ HASH REFS ]]
  144 
  145 sub check_hashref {
  146     { my void $RETURN_TYPE };
  147     ( my hashref $input_1) = @ARG;
  148 
  149 #    RPerl::diag("in check_hashref(), received \$input_1\n" . Dumper($input_1) . "\n");
  150     return;
  151 }
  152 
  153 sub check_integer_hashref {
  154     { my void $RETURN_TYPE };
  155     ( my integer_hashref $input_1) = @ARG;
  156 
  157 #    RPerl::diag("in check_integer_hashref(), received \$input_1\n" . Dumper($input_1) . "\n");
  158     return;
  159 }
  160 
  161 sub check_number_hashref {
  162     { my void $RETURN_TYPE };
  163     ( my number_hashref $input_1) = @ARG;
  164 
  165 #    RPerl::diag("in check_number_hashref(), received \$input_1\n" . Dumper($input_1) . "\n");
  166     return;
  167 }
  168 
  169 sub check_number_hashrefs {
  170     { my void $RETURN_TYPE };
  171     (   my number_hashref $input_1,
  172         my number_hashref $input_2,
  173         my number_hashref $input_3)
  174         = @ARG;
  175 
  176 #    RPerl::diag("in check_number_hashrefs(), received \$input_1\n" . Dumper($input_1) . "\n");
  177 #    RPerl::diag("in check_number_hashrefs(), received \$input_2\n" . Dumper($input_2) . "\n");
  178 #    RPerl::diag("in check_number_hashrefs(), received \$input_3\n" . Dumper($input_3) . "\n");
  179     return;
  180 }
  181 
  182 sub check_string_hashref {
  183     { my void $RETURN_TYPE };
  184     ( my string_hashref $input_1) = @ARG;
  185 
  186 #    RPerl::diag("in check_string_hashref(), received \$input_1\n" . Dumper($input_1) . "\n");
  187     return;
  188 }
  189 
  190 # [[ MIXED TYPES ]]
  191 
  192 sub check__mixed_00 {
  193     { my void $RETURN_TYPE };
  194     ( my integer $input_1, my number $input_2, my string $input_3) = @ARG;
  195 
  196 #    RPerl::diag("in check__mixed_00(), received \$input_1\n" . Dumper($input_1) . "\n");
  197 #    RPerl::diag("in check__mixed_00(), received \$input_2\n" . Dumper($input_2) . "\n");
  198 #    RPerl::diag("in check__mixed_00(), received \$input_3\n" . Dumper($input_3) . "\n");
  199     return;
  200 }
  201 
  202 sub check__mixed_01 {
  203     { my void $RETURN_TYPE };
  204     (   my arrayref $input_1,
  205         my integer_arrayref $input_2,
  206         my number_arrayref $input_3,
  207         my string_arrayref $input_4)
  208         = @ARG;
  209 
  210 #    RPerl::diag("in check__mixed_01(), received \$input_1\n" . Dumper($input_1) . "\n");
  211 #    RPerl::diag("in check__mixed_01(), received \$input_2\n" . Dumper($input_2) . "\n");
  212 #    RPerl::diag("in check__mixed_01(), received \$input_3\n" . Dumper($input_3) . "\n");
  213 #    RPerl::diag("in check__mixed_01(), received \$input_4\n" . Dumper($input_4) . "\n");
  214     return;
  215 }
  216 
  217 sub check__mixed_02 {
  218     { my void $RETURN_TYPE };
  219     (   my hashref $input_1,
  220         my integer_hashref $input_2,
  221         my number_hashref $input_3,
  222         my string_hashref $input_4)
  223         = @ARG;
  224 
  225 #    RPerl::diag("in check__mixed_02(), received \$input_1\n" . Dumper($input_1) . "\n");
  226 #    RPerl::diag("in check__mixed_02(), received \$input_2\n" . Dumper($input_2) . "\n");
  227 #    RPerl::diag("in check__mixed_02(), received \$input_3\n" . Dumper($input_3) . "\n");
  228 #    RPerl::diag("in check__mixed_02(), received \$input_4\n" . Dumper($input_4) . "\n");
  229     return;
  230 }
  231 
  232 sub check__mixed_03 {
  233     { my void $RETURN_TYPE };
  234     (   my integer $input_1,
  235         my number $input_2,
  236         my string $input_3,
  237         my arrayref $input_4,
  238         my integer_arrayref $input_5,
  239         my number_arrayref $input_6,
  240         my string_arrayref $input_7,
  241         my hashref $input_8,
  242         my integer_hashref $input_9,
  243         my number_hashref $input_10,
  244         my string_hashref $input_11
  245     ) = @ARG;
  246 
  247 #    RPerl::diag("in check__mixed_03(), received \$input_1\n" . Dumper($input_1) . "\n");
  248 #    RPerl::diag("in check__mixed_03(), received \$input_2\n" . Dumper($input_2) . "\n");
  249 #    RPerl::diag("in check__mixed_03(), received \$input_3\n" . Dumper($input_3) . "\n");
  250 #    RPerl::diag("in check__mixed_03(), received \$input_4\n" . Dumper($input_4) . "\n");
  251 #    RPerl::diag("in check__mixed_03(), received \$input_5\n" . Dumper($input_5) . "\n");
  252 #    RPerl::diag("in check__mixed_03(), received \$input_6\n" . Dumper($input_6) . "\n");
  253 #    RPerl::diag("in check__mixed_03(), received \$input_7\n" . Dumper($input_7) . "\n");
  254 #    RPerl::diag("in check__mixed_03(), received \$input_8\n" . Dumper($input_8) . "\n");
  255 #    RPerl::diag("in check__mixed_03(), received \$input_9\n" . Dumper($input_9) . "\n");
  256 #    RPerl::diag("in check__mixed_03(), received \$input_10\n" . Dumper($input_10) . "\n");
  257 #    RPerl::diag("in check__mixed_03(), received \$input_11\n" . Dumper($input_11) . "\n");
  258     return;
  259 }
  260 
  261 1;    # end of class