| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Gherkin::ParserContext; | 
| 2 |  |  |  |  |  |  | $Gherkin::ParserContext::VERSION = '27.0.0'; | 
| 3 | 1 |  |  | 1 |  | 8 | use strict; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 30 |  | 
| 4 | 1 |  |  | 1 |  | 4 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 27 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 5 | use List::Util qw( uniq ); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 66 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 1 |  |  |  |  | 8 | use Class::XSAccessor accessors => | 
| 9 | 1 |  |  | 1 |  | 6 | [ qw/token_scanner token_matcher token_queue _errors/, ]; | 
|  | 1 |  |  |  |  | 1 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | sub new { | 
| 12 | 3 |  |  | 3 | 0 | 9 | my ( $class, $options ) = @_; | 
| 13 | 3 |  | 50 |  |  | 15 | $options->{'token_queue'} ||= []; | 
| 14 | 3 |  | 50 |  |  | 13 | $options->{'_errors'}     ||= []; | 
| 15 | 3 |  |  |  |  | 10 | bless $options, $class; | 
| 16 |  |  |  |  |  |  | } | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 0 |  |  | 0 | 0 | 0 | sub add_tokens { my $self = shift; push( @{ $self->token_queue }, @_ ); } | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 19 | 3 |  |  | 3 | 0 | 6 | sub errors     { my $self = shift; return @{ $self->_errors } } | 
|  | 3 |  |  |  |  | 4 |  | 
|  | 3 |  |  |  |  | 14 |  | 
| 20 |  |  |  |  |  |  | sub add_errors { | 
| 21 | 0 |  |  | 0 | 0 | 0 | my $self = shift; | 
| 22 | 0 |  |  |  |  | 0 | push @{ $self->{'_errors'} }, @_; | 
|  | 0 |  |  |  |  | 0 |  | 
| 23 |  |  |  |  |  |  | } | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | sub read_token { | 
| 26 | 36 |  |  | 36 | 0 | 58 | my ($self) = shift(); | 
| 27 | 36 |  | 33 |  |  | 47 | return shift( @{ $self->token_queue } ) || $self->token_scanner->read; | 
| 28 |  |  |  |  |  |  | } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | 1; |