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   556 use strict;
  1         1  
  1         35  
2 1     1   5 use warnings;
  1         2  
  1         49  
3              
4             package LispParser;
5 1     1   5 use base qw( Parser::MGC );
  1         2  
  1         592  
6              
7 1     1   11 use constant pattern_ident => qr{[[:alnum:]+*/._:-]+};
  1         3  
  1         188  
8              
9             sub parse
10             {
11 7     7   11 my $self = shift;
12              
13             $self->sequence_of( sub {
14             $self->any_of(
15 12         25 sub { $self->token_int },
16 6         16 sub { $self->token_string },
17 5         15 sub { \$self->token_ident },
18 3         15 sub { $self->scope_of( "(", \&parse, ")" ) }
19 12     12   86 );
20 7         43 } );
21             }
22              
23 1     1   913 use Data::Dumper;
  1         7660  
  1         148  
24              
25             if( !caller ) {
26             my $parser = __PACKAGE__->new;
27              
28             print Dumper( $parser->from_file( $ARGV[0] ) );
29             }
30              
31             1;