File Coverage

examples/synopsis.pl
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 29 29 100.0


line stmt bran cond sub pod time code
1 1     1   368 use strict;
  1         1  
  1         26  
2 1     1   5 use warnings;
  1         1  
  1         30  
3              
4             package LispParser;
5 1     1   4 use base qw( Parser::MGC );
  1         2  
  1         455  
6              
7 1     1   7 use constant pattern_ident => qr{[[:alnum:]+*/._:-]+};
  1         1  
  1         122  
8              
9             sub parse
10             {
11 7     7   8 my $self = shift;
12              
13             $self->sequence_of( sub {
14             $self->any_of(
15 12         19 sub { $self->token_int },
16 6         13 sub { $self->token_string },
17 5         10 sub { \$self->token_ident },
18 3         10 sub { $self->scope_of( "(", \&parse, ")" ) }
19 12     12   72 );
20 7         31 } );
21             }
22              
23 1     1   491 use Data::Dumper;
  1         5699  
  1         93  
24              
25             if( !caller ) {
26             my $parser = __PACKAGE__->new;
27              
28             print Dumper( $parser->from_file( $ARGV[0] ) );
29             }
30              
31             1;