================
@@ -386,6 +386,10 @@ def __contains__(self, other):
         # same file, in between lines
         if self.start.line < other.line < self.end.line:
             return True
+        # between columns in one-liner range
+        elif self.start.line == other.line == self.end.line:
----------------
Endilll wrote:

> and in order to have a clean implementation, we would like a 
> SourceLocation.__le__ / SourceLOcation.__lt__ that is not file-sensitive

I'm against anything non file-sensitive, because that's buggy and is going to 
surprise everyone. I'm less concerned with cleanliness of implementation in the 
face of this concern.

At this point I'm even more concerned by amount of places that interpret raw 
encoding of `SourceLocation`, even though (in my understanding) `SourceManager` 
is the only entity that should do so. I'd like to hear from Aaron on Monday on 
this. After that it should be more clear how we should proceed on all three 
levels of our API.

https://github.com/llvm/llvm-project/pull/101802
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to