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

Unified Diff: tools/gn/location.cc

Issue 1525183002: tools/gn: rename char_offset to column_number (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indentation Created 5 years 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/location.h ('k') | tools/gn/parse_tree.cc » ('j') | 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 59b99d6f44ec0069b8025c2208a4f942145c2a8f..49ca3ffe717f7c1550eae1f25f4c28f73b63b6ac 100644
--- a/tools/gn/location.cc
+++ b/tools/gn/location.cc
@@ -13,23 +13,23 @@
Location::Location()
: file_(nullptr),
line_number_(-1),
- char_offset_(-1) {
+ column_number_(-1) {
}
Location::Location(const InputFile* file,
int line_number,
- int char_offset,
+ int column_number,
int byte)
: file_(file),
line_number_(line_number),
- char_offset_(char_offset),
+ column_number_(column_number),
byte_(byte) {
}
bool Location::operator==(const Location& other) const {
return other.file_ == file_ &&
other.line_number_ == line_number_ &&
- other.char_offset_ == char_offset_;
+ other.column_number_ == column_number_;
}
bool Location::operator!=(const Location& other) const {
@@ -38,11 +38,11 @@ bool Location::operator!=(const Location& other) const {
bool Location::operator<(const Location& other) const {
DCHECK(file_ == other.file_);
- return std::tie(line_number_, char_offset_) <
- std::tie(other.line_number_, other.char_offset_);
+ return std::tie(line_number_, column_number_) <
+ std::tie(other.line_number_, other.column_number_);
}
-std::string Location::Describe(bool include_char_offset) const {
+std::string Location::Describe(bool include_column_number) const {
if (!file_)
return std::string();
@@ -54,9 +54,9 @@ std::string Location::Describe(bool include_char_offset) const {
ret += ":";
ret += base::IntToString(line_number_);
- if (include_char_offset) {
+ if (include_column_number) {
ret += ":";
- ret += base::IntToString(char_offset_);
+ ret += base::IntToString(column_number_);
}
return ret;
}
« no previous file with comments | « tools/gn/location.h ('k') | tools/gn/parse_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698