| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/json.h" | 5 #include "vm/json.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 case '6': | 177 case '6': |
| 178 case '7': | 178 case '7': |
| 179 case '8': | 179 case '8': |
| 180 case '9': | 180 case '9': |
| 181 case '-': | 181 case '-': |
| 182 ScanNumber(); | 182 ScanNumber(); |
| 183 break; | 183 break; |
| 184 default: | 184 default: |
| 185 if (IsLiteral("true")) { | 185 if (IsLiteral("true")) { |
| 186 token_ = TokenTrue; | 186 token_ = TokenTrue; |
| 187 token_length_ = 4; |
| 187 } else if (IsLiteral("false")) { | 188 } else if (IsLiteral("false")) { |
| 188 token_ = TokenFalse; | 189 token_ = TokenFalse; |
| 190 token_length_ = 5; |
| 189 } else if (IsLiteral("null")) { | 191 } else if (IsLiteral("null")) { |
| 190 token_ = TokenNull; | 192 token_ = TokenNull; |
| 193 token_length_ = 4; |
| 191 } else { | 194 } else { |
| 192 token_length_ = 0; | 195 token_length_ = 0; |
| 193 token_ = TokenIllegal; | 196 token_ = TokenIllegal; |
| 194 } | 197 } |
| 195 } | 198 } |
| 196 } | 199 } |
| 197 | 200 |
| 198 | 201 |
| 199 JSONReader::JSONReader(const char* json_object) | 202 JSONReader::JSONReader(const char* json_object) |
| 200 : scanner_(json_object) { | 203 : scanner_(json_object) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 340 |
| 338 void TextBuffer::GrowBuffer(intptr_t len) { | 341 void TextBuffer::GrowBuffer(intptr_t len) { |
| 339 intptr_t new_size = buf_size_ + len; | 342 intptr_t new_size = buf_size_ + len; |
| 340 char* new_buf = reinterpret_cast<char*>(realloc(buf_, new_size)); | 343 char* new_buf = reinterpret_cast<char*>(realloc(buf_, new_size)); |
| 341 ASSERT(new_buf != NULL); | 344 ASSERT(new_buf != NULL); |
| 342 buf_ = new_buf; | 345 buf_ = new_buf; |
| 343 buf_size_ = new_size; | 346 buf_size_ = new_size; |
| 344 } | 347 } |
| 345 | 348 |
| 346 } // namespace dart | 349 } // namespace dart |
| OLD | NEW |