[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Further C++ operators for position

From: Matthew Fernandez
Subject: Re: Further C++ operators for position
Date: Tue, 5 Nov 2019 07:04:33 -0800

> On Nov 4, 2019, at 22:58, Akim Demaille <address@hidden> wrote:
> hi Matthew,
>> Le 5 nov. 2019 à 02:10, Matthew Fernandez <address@hidden> a écrit :
>>> On Nov 4, 2019, at 12:16, Hans Åberg <address@hidden> wrote:
>>>> On 4 Nov 2019, at 18:12, Akim Demaille <address@hidden> wrote:
>>>> If we want a total order here, it's actually easy: positions should have a 
>>>> counter somewhere which is the *total* "offset" since the first byte of 
>>>> the first file.  Or something like that.
>> Is it? What if you parsed two separate input sources? It makes no sense to 
>> order a position in one file with respect to a position in the other.
> Maybe I should have used the word "offset" here, which was to read together 
> with the "*total*" before it.
> What I mean is a unique counter you increment each time you read a char, 
> whatever the file.  Printed after @ below.
> main.c:1@1 < foo.h:1@16 < ... < foo.h:42@1010 < ... < main.c:3@2020.

No, I meant that you could instantiate the parser twice and parse two unrelated 
files. Each of the two resulting ASTs will have attached locations and 
positions. It seems to me that it doesn’t make sense to compare a position from 
one AST to a position in the other.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]