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

Unified Diff: tools/gn/tokenizer.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/tokenizer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/tokenizer.cc
diff --git a/tools/gn/tokenizer.cc b/tools/gn/tokenizer.cc
index 4dd71d5beaf953e66acaeb19a7d062270f632ee7..0568becbc8dcb51f92808b74c14a83de5cc45f32 100644
--- a/tools/gn/tokenizer.cc
+++ b/tools/gn/tokenizer.cc
@@ -74,7 +74,7 @@ Tokenizer::Tokenizer(const InputFile* input_file, Err* err)
err_(err),
cur_(0),
line_number_(1),
- char_in_line_(1) {
+ column_number_(1) {
}
Tokenizer::~Tokenizer() {
@@ -126,7 +126,8 @@ std::vector<Token> Tokenizer::Run() {
(tokens_.empty() || tokens_.back().type() != Token::SUFFIX_COMMENT ||
tokens_.back().location().line_number() + 1 !=
location.line_number() ||
- tokens_.back().location().char_offset() != location.char_offset())) {
+ tokens_.back().location().column_number() !=
+ location.column_number())) {
type = Token::LINE_COMMENT;
if (!at_end()) // Could be EOF.
Advance(); // The current \n.
@@ -374,16 +375,16 @@ void Tokenizer::Advance() {
DCHECK(cur_ < input_.size());
if (IsCurrentNewline()) {
line_number_++;
- char_in_line_ = 1;
+ column_number_ = 1;
} else {
- char_in_line_++;
+ column_number_++;
}
cur_++;
}
Location Tokenizer::GetCurrentLocation() const {
return Location(
- input_file_, line_number_, char_in_line_, static_cast<int>(cur_));
+ input_file_, line_number_, column_number_, static_cast<int>(cur_));
}
Err Tokenizer::GetErrorForInvalidToken(const Location& location) const {
« no previous file with comments | « tools/gn/tokenizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698