File Coverage

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


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3 1     1   377386 use v5.14;
  1         5  
4 1     1   12 use warnings;
  1         2  
  1         108  
5              
6             package LispParser;
7 1     1   7 use base qw( Parser::MGC );
  1         2  
  1         794  
8              
9 1     1   9 use constant pattern_ident => qr{[[:alnum:]+*/._:-]+};
  1         2  
  1         241  
10              
11             sub parse
12             {
13 7     7   20 my $self = shift;
14              
15             $self->sequence_of( sub {
16             $self->any_of(
17 12         37 sub { $self->token_int },
18 6         21 sub { $self->token_string },
19 5         45 sub { \$self->token_ident },
20 3         19 sub { $self->scope_of( "(", \&parse, ")" ) }
21 12     12   121 );
22 7         63 } );
23             }
24              
25 1     1   728 use Data::Dumper;
  1         10416  
  1         156  
26              
27             if( !caller ) {
28             my $parser = __PACKAGE__->new;
29              
30             print Dumper( $parser->from_file( $ARGV[0] ) );
31             }
32              
33             1;