1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
package PPI::Statement::Include;
# Commands that call in other files ( or 'uncall' them :/ )
# use, no and require.
### Should require should be a function, not a special statement?
use strict;
use UNIVERSAL 'isa';
use base 'PPI::Statement';
use vars qw{$VERSION};
BEGIN {
$VERSION = '0.903';
}
sub type {
my $self = shift;
my $keyword = $self->schild(0) or return undef;
isa($keyword, 'PPI::Token::Word') and $keyword->content;
}
sub module {
my $self = shift;
my $module = $self->schild(1) or return undef;
isa($module, 'PPI::Token::Word') and $module->content;
}
sub pragma {
my $self = shift;
my $module = $self->module or return '';
$module =~ /^[a-z]/ ? $module : '';
}
sub version {
my $self = shift;
my $version = $self->schild(1) or return undef;
isa(ref $version, 'PPI::Token::Number') ? $version->content : '';
}
1;
|