Avoid warnings for undefined variables.
Patch by kareila.
diffs (30 lines):
diff -r 4fdcb0ec6110 -r edaae09fa13e S2/NodeTerm.pm
--- a/S2/NodeTerm.pm Sat Oct 30 12:20:47 2010 +0800
+++ b/S2/NodeTerm.pm Thu Dec 23 10:53:34 2010 -0600
@@ -465,8 +465,11 @@ sub parse {
}
# function/method call
- if ($nt->{'type'} == $METHCALL || $t->isa('S2::TokenIdent')) {
- $nt->{'type'} = $FUNCCALL unless $nt->{'type'} == $METHCALL;
+ my $isa_methcall = defined $nt->{type} ?
+ $nt->{type} == $METHCALL :
+ ! defined $METHCALL;
+ if ( $isa_methcall || $t->isa('S2::TokenIdent') ) {
+ $nt->{'type'} = $FUNCCALL unless $isa_methcall;
$nt->{'funcIdent'} = $nt->getIdent($toker);
$nt->{'funcArgs'} = parse S2::NodeArguments $toker;
$nt->addNode($nt->{'funcArgs'});
diff -r 4fdcb0ec6110 -r edaae09fa13e S2/Tokenizer.pm
--- a/S2/Tokenizer.pm Sat Oct 30 12:20:47 2010 +0800
+++ b/S2/Tokenizer.pm Thu Dec 23 10:53:34 2010 -0600
@@ -92,7 +92,8 @@ sub moveLineCol {
# print STDERR "Chars: $t [$t->{'chars'}] Lines: $newlines\n";
$this->{'line'} += $newlines;
$t->{'chars'} =~ /\n(.+)$/m;
- $this->{'col'} = 1 + length $1;
+ my $match = defined $1 ? $1 : '';
+ $this->{col} = 1 + length $match;
} else {
# print STDERR "Chars: $t [$t->{'chars'}]\n";
$this->{'col'} += length $t->{'chars'};
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog