> On Nov 4, 2019, at 22:58, Akim Demaille <a...@lrde.epita.fr> wrote:
>
> hi Matthew,
>
>> Le 5 nov. 2019 à 02:10, Matthew Fernandez <matthew.fernan...@gmail.com> a
>> écrit :
>>
>>> On Nov 4, 2019, at 12:16, Hans Åberg <haber...@telia.com> wrote:
>>>
>>>> On 4 Nov 2019, at 18:12, Akim Demaille <a...@lrde.epita.fr> 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.