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

Side by Side Diff: runtime/lib/integers.cc

Issue 36323003: - Ensure that the token stream from generated source matches the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/exceptions.h" 9 #include "vm/exceptions.h"
10 #include "vm/native_entry.h" 10 #include "vm/native_entry.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (p_end == (cstr + len)) { 201 if (p_end == (cstr + len)) {
202 if ((int_value != LLONG_MIN) && (int_value != LLONG_MAX)) { 202 if ((int_value != LLONG_MIN) && (int_value != LLONG_MAX)) {
203 return Integer::New(int_value); 203 return Integer::New(int_value);
204 } 204 }
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 Scanner scanner(value, Symbols::Empty()); 209 Scanner scanner(value, Symbols::Empty());
210 const Scanner::GrowableTokenStream& tokens = scanner.GetStream(); 210 const Scanner::GrowableTokenStream& tokens = scanner.GetStream();
211 String* int_string; 211 const String* int_string;
212 bool is_positive; 212 bool is_positive;
213 if (Scanner::IsValidLiteral(tokens, 213 if (Scanner::IsValidLiteral(tokens,
214 Token::kINTEGER, 214 Token::kINTEGER,
215 &is_positive, 215 &is_positive,
216 &int_string)) { 216 &int_string)) {
217 if (is_positive) { 217 if (is_positive) {
218 return Integer::New(*int_string); 218 return Integer::New(*int_string);
219 } 219 }
220 String& temp = String::Handle(); 220 String& temp = String::Handle();
221 temp = String::Concat(Symbols::Dash(), *int_string); 221 temp = String::Concat(Symbols::Dash(), *int_string);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // Use the preallocated out of memory exception to avoid calling 401 // Use the preallocated out of memory exception to avoid calling
402 // into dart code or allocating any code. 402 // into dart code or allocating any code.
403 const Instance& exception = 403 const Instance& exception =
404 Instance::Handle(isolate->object_store()->out_of_memory()); 404 Instance::Handle(isolate->object_store()->out_of_memory());
405 Exceptions::Throw(exception); 405 Exceptions::Throw(exception);
406 UNREACHABLE(); 406 UNREACHABLE();
407 return 0; 407 return 0;
408 } 408 }
409 409
410 } // namespace dart 410 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/exceptions.cc » ('j') | runtime/vm/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698