sub new {
my $class = shift;
+ my %params = @_;
my $self = {};
if ($class ne __PACKAGE__) {
unless($@) {
# Available. Return a JSLexArrayParser object
- return videosite::JSLexArrayParser->new();
+ return videosite::JSLexArrayParser->new(%params);
}
# See if JSSimleArrayParser is available
unless ($@) {
# Available. Return a JSSimpleArrayParser object
- return videosite::JSSimpleArrayParser->new();
+ return videosite::JSSimpleArrayParser->new(%params);
}
# Nothing available. Return ourselves.
QUADHEX => 'u[0-9a-fA-F]{4}',
INTEGER => '[0-9]+',
QUOTEDNORMAL => '[nr]',
- SIMPLECHAR => '[-\w\._\?\+=\&\!%<>;]+',
+ SIMPLECHAR => '[-\w\._\?\+=\&\!%<>;\#]+',
BACKSLASH => '\\\\',
SLASH => '/',
COMMA => ',',
sub new {
my $class = shift;
+ my %params = @_;
my $self = $class->SUPER::new();
$self->{'_PARSER'} = videosite::JSONNospace->new();
$self->{'_LEXER'} = Parse::Lex->new(@tokens);
+ $self->{'_PARAMS'} = \%params;
return bless($self, $class);
}
my $tok = $l->next();
return ('', undef) unless $tok;
return ('', undef) if $l->eoi();
+ print STDERR $tok->text(), "\n" if (exists($self->{'_PARAMS'}->{'debug'}) and ($self->{'_PARAMS'}->{'debug'} > 0));
return ($tok->name(), $tok->text());
},
yyerror => sub {
$_[0]->YYAbort();
},
- yydebug => 0x0);
+ yydebug => (exists($self->{'_PARAMS'}->{'debug'})?$self->{'_PARAMS'}->{'debug'}:0x0));
return ref($result)?$result->[0]:$result;
}