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

Side by Side Diff: base/json/json_parser.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « base/json/json_file_value_serializer.cc ('k') | base/logging.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/json/json_parser.h" 5 #include "base/json/json_parser.h"
6 6
7 #include "base/float_util.h" 7 #include "base/float_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 421 }
422 422
423 bool JSONParser::EatComment() { 423 bool JSONParser::EatComment() {
424 if (*pos_ != '/' || !CanConsume(1)) 424 if (*pos_ != '/' || !CanConsume(1))
425 return false; 425 return false;
426 426
427 char next_char = *NextChar(); 427 char next_char = *NextChar();
428 if (next_char == '/') { 428 if (next_char == '/') {
429 // Single line comment, read to newline. 429 // Single line comment, read to newline.
430 while (CanConsume(1)) { 430 while (CanConsume(1)) {
431 char next_char = *NextChar(); 431 next_char = *NextChar();
432 if (next_char == '\n' || next_char == '\r') 432 if (next_char == '\n' || next_char == '\r')
433 return true; 433 return true;
434 } 434 }
435 } else if (next_char == '*') { 435 } else if (next_char == '*') {
436 char previous_char = '\0'; 436 char previous_char = '\0';
437 // Block comment, read until end marker. 437 // Block comment, read until end marker.
438 while (CanConsume(1)) { 438 while (CanConsume(1)) {
439 next_char = *NextChar(); 439 next_char = *NextChar();
440 if (previous_char == '*' && next_char == '/') { 440 if (previous_char == '*' && next_char == '/') {
441 // EatWhitespaceAndComments will inspect pos_, which will still be on 441 // EatWhitespaceAndComments will inspect pos_, which will still be on
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 const std::string& description) { 956 const std::string& description) {
957 if (line || column) { 957 if (line || column) {
958 return StringPrintf("Line: %i, column: %i, %s", 958 return StringPrintf("Line: %i, column: %i, %s",
959 line, column, description.c_str()); 959 line, column, description.c_str());
960 } 960 }
961 return description; 961 return description;
962 } 962 }
963 963
964 } // namespace internal 964 } // namespace internal
965 } // namespace base 965 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_file_value_serializer.cc ('k') | base/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698