File Coverage

blib/lib/Jmespath/ParseException.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Jmespath::ParseException;
2 3     3   1563 use Moose;
  3         3  
  3         13  
3             extends 'Jmespath::JMESPathException';
4             with 'Throwable';
5              
6             has message => ( is => 'ro',
7             default => 'Invalid jmespath expression' );
8             has expression => ( is => 'rw' );
9             has lex_position => ( is => 'ro' );
10             has token_type => ( is => 'ro' );
11             has token_value => ( is => 'ro' );
12              
13             override 'to_string', sub {
14             my $self = shift;
15             my $underline = ( ' ' x ( $self->lex_position + 1 ) ) . '^';
16             my $mf = '%s : Parse error at column %s token "%s" (%s), ' .
17             'for expression:' . "\n" . '"%s"' . "\n" . '%s' . "\n";
18             return sprintf $mf,
19             $self->message,
20             $self->lex_position,
21             $self->token_value,
22             $self->token_type,
23             $self->expression,
24             $underline;
25             };
26              
27 3     3   11820 no Moose;
  3         3  
  3         15  
28             1;