SourceForge has been redesigned. Learn more.
Close

#490 source parsing confused by '?' in qq blocks

v0.6.x
open
nobody
Editor (234)
5
2008-03-27
2008-03-27
Anonymous
No

With Eclispe 3.2 and both EPIC v0.5.x / v0.6.x, I encounter the following issue:

In a module, I have a list a SQL requests initialized with qq blocks into the module's instance hash. However requests that have an odd number of '?' character seem to break the parser, since everything after the qq block until the next '?' (which is in code, not in a comment) is displayed incorrectly.

And these "lost" code-parts may cause missing subroutines in the outline if there's not last '?' after the last occurence of the problem.

Using perl -c on the code shows no syntax error so the code is valid.

Here's a sample package with the qq declarations that shows the problem :

package testsyntax;

sub new
{
my ($class,$handle) = @_;
my $self = {};
bless $self,$class;
$self->{'db'}->{'handle'} = $handle;
return $self;
}

sub init_requests
{
my $self = shift;

$self->{'db'}->{'request1'}->{'query'} = qq{
SELECT COLUMN2
FROM TABLE1
WHERE COLUMN1 = ?
};
$self->{'db'}->{'request1'}->{'statement'} = $self->{'db'}->{'handle'}->prepare( $self->{'db'}->{'request1'}->{'query'} )
|| die("Cannot prepare query...");
print "\nQuery : " . $self->{'db'}->{'request1'}->{'query'}, " successfully prepared\n";
#
#-----------------------------------------------
#
$self->{'db'}->{'request2'}->{'query'} = qq{
SELECT COLUMN3
FROM TABLE2
WHERE COLUMN1 = ?
AND COLUMN2 = ?
};
$self->{'db'}->{'request2'}->{'statement'} = $self->{'db'}->->{'handle'}->prepare( $self->{'db'}->{'request2'}->{'query'} )
|| die("Cannot prepare query...");
print "\nQuery : " . $self->{'db'}->{'request2'}->{'query'}, " successfully prepared\n";
}

1;
__END__

Discussion


Log in to post a comment.