#75 make PDL::NiceSlice preserve line numbering

None
closed
None
5
2013-10-06
2013-04-11
No

I'm seeing that under some conditions NiceSlice makes unrelated syntax
errors be reported at the wrong line. For example, consider this source
file tst.pl:

use strict;
use PDL;
use PDL::NiceSlice;
my $x;
$x->(0,
0);
f3

Syntactically, this is just fine as PDL code, but the last line is a
syntax error; this is line 7. Running 'perl -c tst.pl' does report the
syntax error, but on line 6, instead of line 7. Commenting out the 'use
PDL::NiceSlice' line makes it work (error reported on line 7). Adding
comments at the end of the NiceSlice access (lines 5,6) makes it work
also.

This is clearly the source filter misbehaving. Can somebody who's
familiar with this code take a look?

dima

Discussion

  • Chris Marshall

    Chris Marshall - 2013-04-11

    PDL::NiceSlice ignores whitespace and comments but the current implementation collapses a multi-line source into a single output of the filtered text. We should, at least pad the filtered output with additional lines so that errors reported for the filtered code match the ones from unfiltered code.

     
  • Chris Marshall

    Chris Marshall - 2013-10-06
    • status: open --> closed
    • assigned_to: Chris Marshall
    • Group: -->
     
  • Chris Marshall

    Chris Marshall - 2013-10-06

    Fixed in git.

     

Log in to post a comment.