Catch unmatched "[" in selector parser with a helpful error
[catagits/HTML-Zoom.git] / lib / HTML / Zoom / ArrayStream.pm
CommitLineData
b5a48c47 1package HTML::Zoom::ArrayStream;
2
3use strict;
4use warnings FATAL => 'all';
5use base qw(HTML::Zoom::StreamBase);
6
7sub new {
8 my ($class, $args) = @_;
9 bless(
10 { _zconfig => $args->{zconfig}, _array => [ @{$args->{array}} ] },
11 $class
12 );
13}
14
15sub _next {
16 my $ary = $_[0]->{_array};
17 return unless @$ary;
18 return shift @$ary;
19}
20
211;