Perlito5/Perl5/Runtime.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 15 CC 1 SCAR 6.9
CC
1
Cov
0%
eval_ast
2.0
emit_perl5
2.0
CRAP 2.0
1 package Perlito5::Perl5::Runtime;
2  
3 sub eval_ast {
4 my ($ast) = @_;
5 my $want = 0;
6  
7 my @data = $ast->emit_perl5(0, $want);
8 my $out = [];
9 Perlito5::Perl5::PrettyPrinter::pretty_print( \@data, 0, $out );
10 my $code = "package $Perlito5::PKG_NAME; " . join( '', @$out ) . "\n";
11 # say STDERR "source: [" . $code . "]";
12 Perlito5::set_global_phase("UNITCHECK");
13 $_->() while $_ = shift @Perlito5::UNITCHECK_BLOCK;
14 $code = "#line $Perlito5::LINE_NUMBER \"$Perlito5::FILE_NAME\"\n" . $code;
15 return eval($code);
16 }
17  
18 sub emit_perl5 {
19 return <<'EOT';
20  
21 use v5.10;
22 use feature 'say';
23  
24 EOT
25 }
26  
27 1;
28  
29 =pod
30  
31 =head1 NAME
32  
33 Perlito5::Perl5::Runtime
34  
35 =head1 DESCRIPTION
36  
37 Provides runtime routines for the Perlito-in-Perl5 compiled code
38  
39 =head1 AUTHORS
40  
41 The Pugs Team.
42  
43 =head1 COPYRIGHT
44  
45 Copyright 2006, 2009, 2011, 2012 by Flavio Soibelmann Glock and others.
46  
47 This program is free software; you can redistribute it and/or modify it
48 under the same terms as Perl itself.
49  
50 See L<http://www.perl.com/perl/misc/Artistic.html>
51  
52 =cut