File Coverage

blib/lib/RPerl/Operation/Expression/Operator/Close.pm
Criterion Covered Total %
statement 26 37 70.2
branch 1 2 50.0
condition n/a
subroutine 6 8 75.0
pod n/a
total 33 47 70.2


line stmt bran cond sub pod time code
1             # [[[ DOCUMENTATION ]]]
2             # http://perldoc.perl.org/functions/close.html
3             # SUPPORTED: close FILEHANDLE
4             # NOT SUPPORTED: close
5              
6             # [[[ HEADER ]]]
7             package RPerl::Operation::Expression::Operator::Close;
8 4     4   23 use strict;
  4         7  
  4         95  
9 4     4   17 use warnings;
  4         8  
  4         86  
10 4     4   19 use RPerl::AfterSubclass;
  4         9  
  4         485  
11             our $VERSION = 0.001_000;
12              
13             # [[[ OO INHERITANCE ]]]
14 4     4   30 use parent qw(RPerl::Operation::Expression::Operator);
  4         10  
  4         22  
15 4     4   210 use RPerl::Operation::Expression::Operator;
  4         15  
  4         883  
16              
17             # [[[ CRITICS ]]]
18             ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
19             ## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils
20              
21             # [[[ OO PROPERTIES ]]]
22             our hashref $properties = {};
23              
24             # [[[ SUBROUTINES & OO METHODS ]]]
25              
26             sub ast_to_rperl__generate {
27 3     3   11 { my string_hashref::method $RETURN_TYPE };
  3         8  
28 3         8 ( my object $self, my string_hashref $modes) = @ARG;
29 3         14 my string_hashref $rperl_source_group = { PMC => q{} };
30 3         9 my string_hashref $rperl_source_subgroup;
31              
32             # RPerl::diag( 'in Operator::Close->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" );
33              
34 3         10 my string $self_class = ref $self;
35 3 50       15 if ( $self_class eq 'Operator_97' ) { # Operator -> OP01_CLOSE FHREF_SYMBOL
36 3         20 my string $close_operator = $self->{children}->[0];
37 3         10 my string $fhref_symbol = $self->{children}->[1];
38              
39 3         15 $rperl_source_group->{PMC} .= $close_operator . q{ } . $fhref_symbol;
40             }
41             else {
42 0         0 die RPerl::Parser::rperl_rule__replace(
43             'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
44             . $self_class
45             . ' found where Operator_97 expected, dying' )
46             . "\n";
47             }
48 3         16 return $rperl_source_group;
49             }
50              
51             sub ast_to_cpp__generate__CPPOPS_PERLTYPES {
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 =>
56             q{// <<< RP::O::E::O::C __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>}
57             . "\n" };
58              
59             #...
60 0           return $cpp_source_group;
61             }
62              
63             sub ast_to_cpp__generate__CPPOPS_CPPTYPES {
64 0     0     { my string_hashref::method $RETURN_TYPE };
  0            
65 0           ( my object $self, my string_hashref $modes) = @ARG;
66 0           my string_hashref $cpp_source_group
67             = { CPP =>
68             q{// <<< RP::O::E::O::C __DUMMY_SOURCE_CODE CPPOPS_CPPTYPES >>>}
69             . "\n" };
70              
71             #...
72 0           return $cpp_source_group;
73             }
74              
75             1; # end of class