[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test results differents between the perl and XS parsers
From: |
Gavin Smith |
Subject: |
Re: test results differents between the perl and XS parsers |
Date: |
Tue, 17 Nov 2020 07:25:26 +0000 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Mon, Nov 16, 2020 at 10:09:59PM -0600, Jacob Bachmeyer wrote:
> Gavin Smith wrote:
> > [...]
> > In the Perl code, however, there is always a current line number object
> > available and when this is referenced the line number is stored as
> > a reference to the object. It looks like
> >
> > $current->{'contents'}->[-1]->{'line_nr'} = $line_nr;
> >
> > Hence the object can easily be shared. Perl's garbage collector
> > takes care of memory leaks.
>
> Wait a minute here... if the line number object is being shared, how do
> elements from different lines get different line numbers?
>
> Why is the line number even an object in the first place? Why not simply
> read $. or use the HANDLE->input_line_number accessor?
It's pointless to speculate about this without looking at or attempting
to change the code. It was surely done this way for a reason.