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

Side by Side Diff: runtime/vm/json.cc

Issue 10175011: Rework mirrors implementation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/json.h ('k') | no next file » | 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 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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/json.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698