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

Side by Side Diff: src/conversions.cc

Issue 3181036: Created collector class and used it to collect identifiers during scanning. (Closed)
Patch Set: Created 10 years, 4 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 | « src/conversions.h ('k') | src/parser.cc » ('j') | src/utils.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 StringInputBuffer buffer(str); 726 StringInputBuffer buffer(str);
727 return InternalStringToInt(StringInputBufferIterator(&buffer), 727 return InternalStringToInt(StringInputBufferIterator(&buffer),
728 StringInputBufferIterator::EndMarker(), 728 StringInputBufferIterator::EndMarker(),
729 radix); 729 radix);
730 } 730 }
731 } 731 }
732 732
733 733
734 double StringToDouble(const char* str, int flags, double empty_string_val) { 734 double StringToDouble(const char* str, int flags, double empty_string_val) {
735 const char* end = str + StrLength(str); 735 const char* end = str + StrLength(str);
736 return InternalStringToDouble(str, end, flags, empty_string_val);
737 }
736 738
737 return InternalStringToDouble(str, end, flags, empty_string_val); 739
740 double StringToDouble(Vector<const char> str,
741 int flags,
742 double empty_string_val) {
743 const char* end = str.start() + str.length();
744 return InternalStringToDouble(str.start(), end, flags, empty_string_val);
738 } 745 }
739 746
740 747
741 extern "C" char* dtoa(double d, int mode, int ndigits, 748 extern "C" char* dtoa(double d, int mode, int ndigits,
742 int* decpt, int* sign, char** rve); 749 int* decpt, int* sign, char** rve);
743 750
744 extern "C" void freedtoa(char* s); 751 extern "C" void freedtoa(char* s);
745 752
746 const char* DoubleToCString(double v, Vector<char> buffer) { 753 const char* DoubleToCString(double v, Vector<char> buffer) {
747 StringBuilder builder(buffer.start(), buffer.length()); 754 StringBuilder builder(buffer.start(), buffer.length());
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 // Allocate result and fill in the parts. 1117 // Allocate result and fill in the parts.
1111 StringBuilder builder(result_size + 1); 1118 StringBuilder builder(result_size + 1);
1112 builder.AddSubstring(integer_buffer + integer_pos + 1, integer_part_size); 1119 builder.AddSubstring(integer_buffer + integer_pos + 1, integer_part_size);
1113 if (decimal_pos > 0) builder.AddCharacter('.'); 1120 if (decimal_pos > 0) builder.AddCharacter('.');
1114 builder.AddSubstring(decimal_buffer, decimal_pos); 1121 builder.AddSubstring(decimal_buffer, decimal_pos);
1115 return builder.Finalize(); 1122 return builder.Finalize();
1116 } 1123 }
1117 1124
1118 1125
1119 } } // namespace v8::internal 1126 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/conversions.h ('k') | src/parser.cc » ('j') | src/utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698