File Coverage

blib/lib/RPerl/CompileUnit/Critic.pm
Criterion Covered Total %
statement 29 39 74.3
branch n/a
condition n/a
subroutine 6 8 75.0
pod n/a
total 35 47 74.4


line stmt bran cond sub pod time code
1             # [[[ HEADER ]]]
2             package RPerl::CompileUnit::Critic;
3 3     3   20 use strict;
  3         9  
  3         100  
4 3     3   20 use warnings;
  3         7  
  3         85  
5 3     3   18 use RPerl::AfterSubclass;
  3         8  
  3         452  
6             our $VERSION = 0.001_000;
7              
8             # [[[ OO INHERITANCE ]]]
9 3     3   23 use parent qw(RPerl::GrammarRule);
  3         7  
  3         19  
10 3     3   191 use RPerl::GrammarRule;
  3         12  
  3         867  
11              
12             # [[[ CRITICS ]]]
13             ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
14             ## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils
15              
16             # [[[ OO PROPERTIES ]]]
17             our hashref $properties = {};
18              
19             # [[[ SUBROUTINES & OO METHODS ]]]
20              
21             sub ast_to_rperl__generate {
22 1172     1172   2425 { my string_hashref::method $RETURN_TYPE };
  1172         2655  
23 1172         3269 ( my object $self, my string_hashref $modes) = @ARG;
24 1172         4885 my string_hashref $rperl_source_group = { PMC => q{} };
25              
26             # RPerl::diag( 'in Critic->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" );
27            
28 1172         4353 my string $no_critic_qw = $self->{children}->[0];
29 1172         3102 my object $critic_words = $self->{children}->[1];
30 1172         3968 my string $right_parenthesis = $self->{children}->[2];
31            
32 1172         3930 $rperl_source_group->{PMC} .= $no_critic_qw;
33 1172         2652 foreach my object $critic_word (@{$critic_words->{children}}) {
  1172         4098  
34 2436         7643 $rperl_source_group->{PMC} .= $critic_word->{attr} . ' ';
35             }
36 1172         3468 chop $rperl_source_group->{PMC}; # remove extra trailing space
37 1172         3270 $rperl_source_group->{PMC} .= $right_parenthesis . "\n";
38 1172         6196 return $rperl_source_group;
39             }
40              
41             sub ast_to_cpp__generate__CPPOPS_PERLTYPES {
42 0     0     { my string_hashref::method $RETURN_TYPE };
  0            
43 0           ( my object $self, my string_hashref $modes) = @ARG;
44 0           my string_hashref $cpp_source_group
45             = { CPP => q{// <<< RP::CU::Cr __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} . "\n" };
46              
47             #...
48 0           return $cpp_source_group;
49             }
50              
51             sub ast_to_cpp__generate__CPPOPS_CPPTYPES {
52 0     0     { my string_hashref::method $RETURN_TYPE };
  0            
53 0           ( my object $self, my string_hashref $modes) = @ARG;
54 0           my string_hashref $cpp_source_group
55             = { CPP => q{// <<< RP::CU::Cr __DUMMY_SOURCE_CODE CPPOPS_CPPTYPES >>>}
56             . "\n" };
57              
58             #...
59 0           return $cpp_source_group;
60             }
61              
62             1; # end of class