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

Unified Diff: tools/gn/location.h

Issue 1905473003: 🐣 GN: Print the import trail when parse errors occur. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move is_null() to header 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
« no previous file with comments | « tools/gn/loader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/location.h
diff --git a/tools/gn/location.h b/tools/gn/location.h
index 44d1a6fe68f614112bf1d57993cc8af8bb92755c..647c6f71227c2287a0099d3b2ccddabe86e0a008 100644
--- a/tools/gn/location.h
+++ b/tools/gn/location.h
@@ -19,6 +19,7 @@ class Location {
int line_number() const { return line_number_; }
int column_number() const { return column_number_; }
int byte() const { return byte_; }
+ bool is_null() const { return *this == Location(); }
bool operator==(const Location& other) const;
bool operator!=(const Location& other) const;
@@ -45,6 +46,10 @@ class LocationRange {
const Location& begin() const { return begin_; }
const Location& end() const { return end_; }
+ bool is_null() const {
+ return begin_.is_null(); // No need to check both for the null case.
+ }
+
LocationRange Union(const LocationRange& other) const;
« no previous file with comments | « tools/gn/loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698