line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
2253
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
61
|
|
2
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
104
|
|
3
|
|
|
|
|
|
|
package Devel::REPL::Plugin::PPI; |
4
|
|
|
|
|
|
|
# ABSTRACT: PPI dumping of Perl code |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.003028'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
7
|
use Devel::REPL::Plugin; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
13
|
|
9
|
2
|
|
|
2
|
|
6210
|
use PPI; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
38
|
|
10
|
2
|
|
|
2
|
|
892
|
use PPI::Dumper; |
|
2
|
|
|
|
|
1533
|
|
|
2
|
|
|
|
|
52
|
|
11
|
2
|
|
|
2
|
|
12
|
use namespace::autoclean; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub BEFORE_PLUGIN { |
14
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
15
|
1
|
|
|
|
|
5
|
$self->load_plugin('Turtles'); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub expr_command_ppi { |
19
|
0
|
|
|
0
|
0
|
|
my ( $self, $eval, $code ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $document = PPI::Document->new(\$code); |
22
|
0
|
|
|
|
|
|
my $dumper = PPI::Dumper->new($document); |
23
|
0
|
|
|
|
|
|
return $dumper->string; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__PACKAGE__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding UTF-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Devel::REPL::Plugin::PPI - PPI dumping of Perl code |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 1.003028 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
repl> #ppi Devel::REPL |
45
|
|
|
|
|
|
|
PPI::Document |
46
|
|
|
|
|
|
|
PPI::Statement |
47
|
|
|
|
|
|
|
PPI::Token::Word 'Devel::REPL' |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
repl> #ppi { |
50
|
|
|
|
|
|
|
> warn $]; |
51
|
|
|
|
|
|
|
> } |
52
|
|
|
|
|
|
|
PPI::Document |
53
|
|
|
|
|
|
|
PPI::Statement::Compound |
54
|
|
|
|
|
|
|
PPI::Structure::Block { ... } |
55
|
|
|
|
|
|
|
PPI::Token::Whitespace '\n' |
56
|
|
|
|
|
|
|
PPI::Statement |
57
|
|
|
|
|
|
|
PPI::Token::Word 'warn' |
58
|
|
|
|
|
|
|
PPI::Token::Whitespace ' ' |
59
|
|
|
|
|
|
|
PPI::Token::Magic '$]' |
60
|
|
|
|
|
|
|
PPI::Token::Structure ';' |
61
|
|
|
|
|
|
|
PPI::Token::Whitespace '\n' |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This plugin provides a C<ppi> command that uses L<PPI::Dumper> to dump |
66
|
|
|
|
|
|
|
L<PPI>-parsed Perl documents. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
The code is not actually executed, which means that when used with |
69
|
|
|
|
|
|
|
L<Deve::REPL::Plugin::OutputCache> there is no new value in C<_>. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SUPPORT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL> |
74
|
|
|
|
|
|
|
(or L<bug-Devel-REPL@rt.cpan.org|mailto:bug-Devel-REPL@rt.cpan.org>). |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
There is also an irc channel available for users of this distribution, at |
77
|
|
|
|
|
|
|
L<C<#devel> on C<irc.perl.org>|irc://irc.perl.org/#devel-repl>. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Shawn M Moore E<lt>sartak@gmail.comE<gt> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>). |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
88
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |