Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: tools/gn/location.cc

Issue 1905473003: 🐣 GN: Print the import trail when parse errors occur. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add null origin check Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/gn/location.h ('K') | « tools/gn/location.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/location.cc
diff --git a/tools/gn/location.cc b/tools/gn/location.cc
index 49ca3ffe717f7c1550eae1f25f4c28f73b63b6ac..ce4f06ff391608438ae87262f9af5cd4f97aa2f2 100644
--- a/tools/gn/location.cc
+++ b/tools/gn/location.cc
@@ -26,6 +26,10 @@ Location::Location(const InputFile* file,
byte_(byte) {
}
+bool Location::is_null() const {
+ return *this == Location();
+}
+
bool Location::operator==(const Location& other) const {
return other.file_ == file_ &&
other.line_number_ == line_number_ &&
@@ -70,6 +74,10 @@ LocationRange::LocationRange(const Location& begin, const Location& end)
DCHECK(begin_.file() == end_.file());
}
+bool LocationRange::is_null() const {
+ return begin_.is_null(); // No need to check both for the null case.
+}
+
LocationRange LocationRange::Union(const LocationRange& other) const {
DCHECK(begin_.file() == other.begin_.file());
return LocationRange(
« tools/gn/location.h ('K') | « tools/gn/location.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698