~ubuntu-branches/ubuntu/trusty/protobuf/trusty-proposed

« back to all changes in this revision

Viewing changes to src/google/protobuf/io/tokenizer.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-05-31 14:41:47 UTC
  • mfrom: (2.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110531144147-s41g5fozgvyo462l
Tags: 2.4.0a-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix linking with -lpthread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
 
194
194
  current_.line = 0;
195
195
  current_.column = 0;
 
196
  current_.end_column = 0;
196
197
  current_.type = TYPE_START;
197
198
 
198
199
  Refresh();
277
278
    current_.text.append(buffer_ + token_start_, buffer_pos_ - token_start_);
278
279
  }
279
280
  token_start_ = -1;
 
281
  current_.end_column = column_;
280
282
}
281
283
 
282
284
// -------------------------------------------------------------------
462
464
// -------------------------------------------------------------------
463
465
 
464
466
bool Tokenizer::Next() {
465
 
  TokenType last_token_type = current_.type;
 
467
  previous_ = current_;
466
468
 
467
469
  // Did we skip any characters after the last token?
468
470
  bool skipped_stuff = false;
517
519
 
518
520
        if (TryConsumeOne<Digit>()) {
519
521
          // It's a floating-point number.
520
 
          if (last_token_type == TYPE_IDENTIFIER && !skipped_stuff) {
 
522
          if (previous_.type == TYPE_IDENTIFIER && !skipped_stuff) {
521
523
            // We don't accept syntax like "blah.123".
522
524
            error_collector_->AddError(line_, column_ - 2,
523
525
              "Need space between identifier and decimal point.");
551
553
  current_.text.clear();
552
554
  current_.line = line_;
553
555
  current_.column = column_;
 
556
  current_.end_column = column_;
554
557
  return false;
555
558
}
556
559