OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <stdarg.h> | 28 #include <stdarg.h> |
29 | 29 |
30 #include "v8.h" | 30 #include "v8.h" |
31 | 31 |
32 #include "conversions-inl.h" | 32 #include "conversions-inl.h" |
33 #include "factory.h" | 33 #include "factory.h" |
34 #include "scanner.h" | 34 #include "scanner.h" |
35 | 35 |
36 namespace v8 { namespace internal { | 36 namespace v8 { |
| 37 namespace internal { |
37 | 38 |
38 int HexValue(uc32 c) { | 39 int HexValue(uc32 c) { |
39 if ('0' <= c && c <= '9') | 40 if ('0' <= c && c <= '9') |
40 return c - '0'; | 41 return c - '0'; |
41 if ('a' <= c && c <= 'f') | 42 if ('a' <= c && c <= 'f') |
42 return c - 'a' + 10; | 43 return c - 'a' + 10; |
43 if ('A' <= c && c <= 'F') | 44 if ('A' <= c && c <= 'F') |
44 return c - 'A' + 10; | 45 return c - 'A' + 10; |
45 return -1; | 46 return -1; |
46 } | 47 } |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 // Allocate result and fill in the parts. | 699 // Allocate result and fill in the parts. |
699 StringBuilder builder(result_size + 1); | 700 StringBuilder builder(result_size + 1); |
700 builder.AddSubstring(integer_buffer + integer_pos + 1, integer_part_size); | 701 builder.AddSubstring(integer_buffer + integer_pos + 1, integer_part_size); |
701 if (decimal_pos > 0) builder.AddCharacter('.'); | 702 if (decimal_pos > 0) builder.AddCharacter('.'); |
702 builder.AddSubstring(decimal_buffer, decimal_pos); | 703 builder.AddSubstring(decimal_buffer, decimal_pos); |
703 return builder.Finalize(); | 704 return builder.Finalize(); |
704 } | 705 } |
705 | 706 |
706 | 707 |
707 } } // namespace v8::internal | 708 } } // namespace v8::internal |
OLD | NEW |