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

Unified Diff: third_party/protobuf/src/google/protobuf/io/tokenizer.cc

Issue 6737030: third_party/protobuf: update to upstream r371 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
Index: third_party/protobuf/src/google/protobuf/io/tokenizer.cc
diff --git a/third_party/protobuf/src/google/protobuf/io/tokenizer.cc b/third_party/protobuf/src/google/protobuf/io/tokenizer.cc
index 38fa351c412e84f6d230c5192217fd6b4c9c390c..513831d55fb47c4fd0ebe4e726b21431c2c08d2b 100644
--- a/third_party/protobuf/src/google/protobuf/io/tokenizer.cc
+++ b/third_party/protobuf/src/google/protobuf/io/tokenizer.cc
@@ -193,6 +193,7 @@ Tokenizer::Tokenizer(ZeroCopyInputStream* input,
current_.line = 0;
current_.column = 0;
+ current_.end_column = 0;
current_.type = TYPE_START;
Refresh();
@@ -277,6 +278,7 @@ inline void Tokenizer::EndToken() {
current_.text.append(buffer_ + token_start_, buffer_pos_ - token_start_);
}
token_start_ = -1;
+ current_.end_column = column_;
}
// -------------------------------------------------------------------
@@ -462,7 +464,7 @@ void Tokenizer::ConsumeBlockComment() {
// -------------------------------------------------------------------
bool Tokenizer::Next() {
- TokenType last_token_type = current_.type;
+ previous_ = current_;
// Did we skip any characters after the last token?
bool skipped_stuff = false;
@@ -517,7 +519,7 @@ bool Tokenizer::Next() {
if (TryConsumeOne<Digit>()) {
// It's a floating-point number.
- if (last_token_type == TYPE_IDENTIFIER && !skipped_stuff) {
+ if (previous_.type == TYPE_IDENTIFIER && !skipped_stuff) {
// We don't accept syntax like "blah.123".
error_collector_->AddError(line_, column_ - 2,
"Need space between identifier and decimal point.");
@@ -551,6 +553,7 @@ bool Tokenizer::Next() {
current_.text.clear();
current_.line = line_;
current_.column = column_;
+ current_.end_column = column_;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698