OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_reader.h" | 5 #include "base/json/json_reader.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/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 | 213 |
214 scoped_ptr<Value> node; | 214 scoped_ptr<Value> node; |
215 | 215 |
216 switch (token.type) { | 216 switch (token.type) { |
217 case Token::END_OF_INPUT: | 217 case Token::END_OF_INPUT: |
218 case Token::INVALID_TOKEN: | 218 case Token::INVALID_TOKEN: |
219 return NULL; | 219 return NULL; |
220 | 220 |
221 case Token::NULL_TOKEN: | 221 case Token::NULL_TOKEN: |
222 node.reset(Value::CreateNullValue()); | 222 node.reset(NullValue()); |
223 break; | 223 break; |
224 | 224 |
225 case Token::BOOL_TRUE: | 225 case Token::BOOL_TRUE: |
226 node.reset(Value::CreateBooleanValue(true)); | 226 node.reset(TrueValue()); |
227 break; | 227 break; |
228 | 228 |
229 case Token::BOOL_FALSE: | 229 case Token::BOOL_FALSE: |
230 node.reset(Value::CreateBooleanValue(false)); | 230 node.reset(FalseValue()); |
231 break; | 231 break; |
232 | 232 |
233 case Token::NUMBER: | 233 case Token::NUMBER: |
234 node.reset(DecodeNumber(token)); | 234 node.reset(DecodeNumber(token)); |
235 if (!node.get()) | 235 if (!node.get()) |
236 return NULL; | 236 return NULL; |
237 break; | 237 break; |
238 | 238 |
239 case Token::STRING: | 239 case Token::STRING: |
240 node.reset(DecodeString(token)); | 240 node.reset(DecodeString(token)); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 ++column_number; | 665 ++column_number; |
666 } | 666 } |
667 } | 667 } |
668 | 668 |
669 error_line_ = line_number; | 669 error_line_ = line_number; |
670 error_col_ = column_number; | 670 error_col_ = column_number; |
671 error_code_ = error; | 671 error_code_ = error; |
672 } | 672 } |
673 | 673 |
674 } // namespace base | 674 } // namespace base |
OLD | NEW |