Subject: | Error Reporting delicate |
The error reporting is suspectible to errors. Please consinder making it
a little more robust wrt. to undefinedness.
Subject: | errors.diff |
--- Parser.pm.orig 2012-02-26 14:12:30.000000000 +0100
+++ Parser.pm 2012-02-26 14:28:33.000000000 +0100
@@ -19,11 +19,16 @@
}
sub error {
- say STDERR "Parse error!";
- print STDERR "Failed token was ", $_[0]->YYCurtok;
- print STDERR ", value ", $_[0]->YYCurval;
- print STDERR ", expected ", join(',', $_[0]->YYExpect);
- print STDERR ".\n";
+ print STDERR "Parse error!\n";
+ if($_ && $_[0] && ref($_[0]) eq 'ARRAY') {
+ print STDERR "Failed token was ", $_[0]->YYCurtok;
+ print STDERR ", value ", $_[0]->YYCurval;
+ print STDERR ", expected ", join(',', $_[0]->YYExpect);
+ print STDERR ".\n";
+ } else {
+ print STDERR "Empty object tree!\n";
+ die("Can not continue w/o object tree!\n");
+ }
}
=head1 NAME