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

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

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.h
diff --git a/third_party/protobuf/src/google/protobuf/io/tokenizer.h b/third_party/protobuf/src/google/protobuf/io/tokenizer.h
index d115161f5823fc85326fdd87e829ec2c091f14a3..8f759abbd886acffcee52b6e9fe542b5b0b425b2 100644
--- a/third_party/protobuf/src/google/protobuf/io/tokenizer.h
+++ b/third_party/protobuf/src/google/protobuf/io/tokenizer.h
@@ -122,12 +122,17 @@ class LIBPROTOBUF_EXPORT Tokenizer {
// the token within the input stream. They are zero-based.
int line;
int column;
+ int end_column;
};
// Get the current token. This is updated when Next() is called. Before
// the first call to Next(), current() has type TYPE_START and no contents.
const Token& current();
+ // Return the previous token -- i.e. what current() returned before the
+ // previous call to Next().
+ const Token& previous();
+
// Advance to the next token. Returns false if the end of the input is
// reached.
bool Next();
@@ -180,6 +185,7 @@ class LIBPROTOBUF_EXPORT Tokenizer {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Tokenizer);
Token current_; // Returned by current().
+ Token previous_; // Returned by previous().
ZeroCopyInputStream* input_;
ErrorCollector* error_collector_;
@@ -291,6 +297,10 @@ inline const Tokenizer::Token& Tokenizer::current() {
return current_;
}
+inline const Tokenizer::Token& Tokenizer::previous() {
+ return previous_;
+}
+
inline void Tokenizer::ParseString(const string& text, string* output) {
output->clear();
ParseStringAppend(text, output);
« no previous file with comments | « third_party/protobuf/src/google/protobuf/io/printer.cc ('k') | third_party/protobuf/src/google/protobuf/io/tokenizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698