Skip Menu |

This queue is for tickets about the ParseLex CPAN distribution.

Report information
The Basics
Id: 48964
Status: resolved
Priority: 0/
Queue: ParseLex

People
Owner: Nobody in particular
Requestors: CASIANO [...] cpan.org
Cc: casiano.rodriguez.leon [...] gmail.com
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.15
Fixed in: (no value)



CC: casiano.rodriguez.leon [...] gmail.com
Subject: tests and non declared variable
Many thanks for the module. As mentioned by other users, the tests fail. There is also a non declared variable in file /Parse/Template.pm that generates errors. I have addressed this issues in the enclosed patch file. To apply it, you can use a command like: /tmp/ParseLex-2.15$ patch -p1 < ../ParseLex_t_and_var_bugs.patch Hope it helps Casiano
Subject: ParseLex_t_and_var_bugs.patch
Only in ParseLex-2.16: Makefile Only in ParseLex-2.16: ParseLex-2.16.tar.gz Only in ParseLex-2.16: blib Only in ParseLex-2.16: deb Only in ParseLex-2.16: err Only in ParseLex-2.16/examples: .tokenizer.pl.swp diff -ur ParseLex-2.15/examples/ctokenizer.pl ParseLex-2.16/examples/ctokenizer.pl --- ParseLex-2.15/examples/ctokenizer.pl 1999-09-23 09:16:24.000000000 +0100 +++ ParseLex-2.16/examples/ctokenizer.pl 2009-08-24 11:17:21.000000000 +0100 @@ -18,7 +18,7 @@ } ); -Parse::CLex->trace; +#Parse::CLex->trace; $lexer = Parse::CLex->new(@token); $lexer->from(\*DATA); Only in ParseLex-2.16/lib/Parse: .Template.pm.swp diff -ur ParseLex-2.15/lib/Parse/ALex.pm ParseLex-2.16/lib/Parse/ALex.pm --- ParseLex-2.15/lib/Parse/ALex.pm 1999-09-27 12:36:51.000000000 +0100 +++ ParseLex-2.16/lib/Parse/ALex.pm 2009-08-24 12:13:48.000000000 +0100 @@ -16,7 +16,7 @@ use strict qw(subs); package Parse::ALex; -$Parse::ALex::VERSION = '2.15'; +$Parse::ALex::VERSION = '2.16'; use Parse::Trace; @Parse::ALex::ISA = qw(Parse::Trace); diff -ur ParseLex-2.15/lib/Parse/Template.pm ParseLex-2.16/lib/Parse/Template.pm --- ParseLex-2.15/lib/Parse/Template.pm 1999-09-23 09:16:28.000000000 +0100 +++ ParseLex-2.16/lib/Parse/Template.pm 2009-08-24 10:58:25.000000000 +0100 @@ -1,4 +1,4 @@ -use strict +use strict; require 5.004; package Parse::Template; $Parse::Template::VERSION = '0.32'; @@ -132,7 +132,7 @@ } # evaluated expressions are not always available in (caller(1))[6]; if (defined($1) and $1 ne '') { - $expr = $1; # what is the template expression? + my $expr = $1; # what is the template expression? { package DB; # what is the part name? @DB::caller = caller(2); # why is this needed? /ee? @DB::caller = caller(1); Only in ParseLex-2.16: pm_to_blib Only in ParseLex-2.16: salida Only in ParseLex-2.16/t: .W.pm.swp Only in ParseLex-2.16/t: .test1.t.swp Only in ParseLex-2.16/t: .test4.t.swp diff -ur ParseLex-2.15/t/W.pm ParseLex-2.16/t/W.pm --- ParseLex-2.15/t/W.pm 1999-09-23 09:16:25.000000000 +0100 +++ ParseLex-2.16/t/W.pm 2009-08-24 11:52:15.000000000 +0100 @@ -31,7 +31,7 @@ local *SAVE_STDERR; open(SAVE_STDERR, ">&STDERR"); open STDERR, "> err"; - open( CMD, "$^X $cmd |" ) or warn "$0: Can't run. $!\n"; + open( CMD, "$^X -Ilib $cmd |" ) or warn "$0: Can't run. $!\n"; @result = <CMD>; close CMD; close STDERR; diff -ur ParseLex-2.15/t/test1.t ParseLex-2.16/t/test1.t --- ParseLex-2.15/t/test1.t 1999-09-27 12:25:19.000000000 +0100 +++ ParseLex-2.16/t/test1.t 2009-08-24 12:23:41.000000000 +0100 @@ -11,10 +11,10 @@ print $test->report(1, sub { my $expectation = $test->expected; my $result = $test->result; - $expectation =~ s/\s+$//; #print STDERR "Result:\n$result\n"; #print STDERR "Expectation:\n$expectation\n"; - $result =~ s/\s+$//; + $expectation =~ s/\s+//g; + $result =~ s/\s+//g; $expectation eq $result; }); @@ -39,7 +39,7 @@ Record number: 3 Type: NEWLINE Content:-> <- -Version 2.15 +Version 2.16 Trace is ON in class Parse::Lex [main::lexer|Parse::Lex] Token read (INTEGER, [1-9][0-9]*): 1 [main::lexer|Parse::Lex] Token read (ADDOP, [-+]): + diff -ur ParseLex-2.15/t/test4.t ParseLex-2.16/t/test4.t --- ParseLex-2.15/t/test4.t 1999-09-23 09:16:26.000000000 +0100 +++ ParseLex-2.16/t/test4.t 2009-08-24 12:09:07.000000000 +0100 @@ -10,8 +10,8 @@ print $test->report(1, sub { my $expectation = $test->expected; my $result = $test->result; - $expectation =~ s/\s+$//; - $result =~ s/\s+$//; + $expectation =~ s/\s+//g; + $result =~ s/\s+//g; unless ($expectation eq $result) { print "$result\n" if $ENV{TEST_VERBOSE}; 0; @@ -21,6 +21,7 @@ }); __END__ + Tokenization of DATA: Record number: 1 Type: INTEGER Content:->1<- @@ -41,17 +42,4 @@ Record number: 3 Type: NEWLINE Content:-> <- -Trace is ON in class Parse::CLex -[main::lexer|Parse::CLex] Token read (INTEGER, [1-9][0-9]*): 1 -[main::lexer|Parse::CLex] Token read (ADDOP, [-+]): + -[main::lexer|Parse::CLex] Token read (INTEGER, [1-9][0-9]*): 2 -[main::lexer|Parse::CLex] Token read (ADDOP, [-+]): - -[main::lexer|Parse::CLex] Token read (INTEGER, [1-9][0-9]*): 5 -[main::lexer|Parse::CLex] Token read (NEWLINE, \n): - -[main::lexer|Parse::CLex] Token read (STRING, \"(?:[^\"]+|\"\")*\"): "This is a multiline -string with an embedded "" in it" -[main::lexer|Parse::CLex] Token read (NEWLINE, \n): - -[main::lexer|Parse::CLex] Token read (ERROR, .*): this is an invalid string with a "" in it" -can't analyze: "this is an invalid string with a "" in it"" at examples/ctokenizer.pl line 17, <DATA> chunk 4. +can't analyze: "this is an invalid string with a "" in it"" at examples/ctokenizer.pl line 17, <DATA> line 4. Only in ParseLex-2.16: testlog
 VERSION 2.16 - 5/01/2010
 
o New maintainer pscust@cpan.org
o Parse::Template 0.33 : Fix syntax errors
  Solves RT #7880, #12845, #14785, #11807, #48964, #53112
o Parse::Token    2.16 : Fix syntax errors
  Solves RT #12845, #36285, #48964, #53112
o test4.t : adapt to current Perl (line vs chunk)
  Solves RT #158, #11808, #11809, #12846, #14785, #48964, #53112
o tests : add blib/lib to Perl path
  Solves RT #48964, #53112
o Added test8.t with code from RT #1861, but error is not reproduced in Perl 5.10, and 
  patch does not work in Perl 5.10; patch not added.