Re: Further C++ operators for position

2019-11-04 Thread Christian Schoenebeck
On Montag, 4. November 2019 07:52:05 CET Akim Demaille wrote: > But what should you do when the files are different? (And Locations are > intervals, so there's no way to compare them totally in a natural order.) > > What we can do, though, is offer implementations for std::less, that would > blin

Re: Further C++ operators for position

2019-11-04 Thread Matthew Fernandez
> On Nov 3, 2019, at 22:52, Akim Demaille wrote: > > Hi Matthew, > >> Le 4 nov. 2019 à 05:27, Matthew Fernandez a >> écrit : >> >> Hello Bison folk, >> >> I recently had a use case for comparing source positions coming out of a C++ >> Bison-produced parser. While operator== and operator!=

Re: Further C++ operators for position

2019-11-04 Thread Hans Åberg
> On 4 Nov 2019, at 07:52, Akim Demaille wrote: > >> Le 4 nov. 2019 à 05:27, Matthew Fernandez a >> écrit : >> >> I recently had a use case for comparing source positions coming out of a C++ >> Bison-produced parser. While operator== and operator!= are implemented on >> the position class

Re: Further C++ operators for position

2019-11-04 Thread Akim Demaille
Hi Matthew, > Le 4 nov. 2019 à 17:03, Matthew Fernandez a > écrit : > > >> On Nov 3, 2019, at 22:52, Akim Demaille wrote: >> >> Hi Matthew, >> >> The semantics for line and columns are quite clear, so comparing Positions >> in the same file is quite well defined. >> >> But what should you

Re: Further C++ operators for position

2019-11-04 Thread Hans Åberg
> On 4 Nov 2019, at 18:12, Akim Demaille wrote: > >> Le 4 nov. 2019 à 17:03, Matthew Fernandez a >> écrit : >> >> The std::less implementation you suggest is to also lexicographically >> compare the filenames themselves? I’m not sure this makes sense, because >> source positions from two d

Re: Further C++ operators for position

2019-11-04 Thread Matthew Fernandez
> On Nov 4, 2019, at 09:12, Akim Demaille wrote: > > Hi Matthew, > >> Le 4 nov. 2019 à 17:03, Matthew Fernandez a >> écrit : >> >> >>> On Nov 3, 2019, at 22:52, Akim Demaille wrote: >>> >>> Hi Matthew, >>> >>> The semantics for line and columns are quite clear, so comparing Positions >>>

Re: Further C++ operators for position

2019-11-04 Thread Akim Demaille
> Le 4 nov. 2019 à 21:16, Hans Åberg a écrit : > > >> On 4 Nov 2019, at 18:12, Akim Demaille wrote: >> >>> Le 4 nov. 2019 à 17:03, Matthew Fernandez a >>> écrit : >>> >>> The std::less implementation you suggest is to also lexicographically >>> compare the filenames themselves? I’m not

Re: Further C++ operators for position

2019-11-04 Thread Akim Demaille
hi Matthew, > Le 5 nov. 2019 à 02:10, Matthew Fernandez a > écrit : > >> On Nov 4, 2019, at 12:16, Hans Åberg wrote: >> >>> On 4 Nov 2019, at 18:12, Akim Demaille wrote: >>> >>> In addition, think of C where you also have main.c that #include "foo.h" >>> somewhere, which results in main.c: