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

Unified Diff: tools/gn/err.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/c_include_iterator_unittest.cc ('k') | tools/gn/header_checker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/err.cc
diff --git a/tools/gn/err.cc b/tools/gn/err.cc
index 319bfa8bb53b8990373495ad40f2d9e1163cb539..1a3db7b8e7138b3405fccdf0731b108f34532b7b 100644
--- a/tools/gn/err.cc
+++ b/tools/gn/err.cc
@@ -37,13 +37,13 @@ void FillRangeOnLine(const LocationRange& range, int line_number,
if (range.begin().line_number() < line_number)
begin_char = 0;
else
- begin_char = range.begin().char_offset() - 1;
+ begin_char = range.begin().column_number() - 1;
int end_char;
if (range.end().line_number() > line_number)
end_char = static_cast<int>(line->size()); // Ending is non-inclusive.
else
- end_char = range.end().char_offset() - 1;
+ end_char = range.end().column_number() - 1;
CHECK(end_char >= begin_char);
CHECK(begin_char >= 0 && begin_char <= static_cast<int>(line->size()));
@@ -69,9 +69,9 @@ void OutputHighlighedPosition(const Location& location,
// Allow the marker to be one past the end of the line for marking the end.
highlight.push_back(' ');
- CHECK(location.char_offset() - 1 >= 0 &&
- location.char_offset() - 1 < static_cast<int>(highlight.size()));
- highlight[location.char_offset() - 1] = '^';
+ CHECK(location.column_number() - 1 >= 0 &&
+ location.column_number() - 1 < static_cast<int>(highlight.size()));
+ highlight[location.column_number() - 1] = '^';
// Trim unused spaces from end of line.
while (!highlight.empty() && highlight[highlight.size() - 1] == ' ')
« no previous file with comments | « tools/gn/c_include_iterator_unittest.cc ('k') | tools/gn/header_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698