| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 | 123 |
| 124 // Returns true if a nonspace character has been found and false if the | 124 // Returns true if a nonspace character has been found and false if the |
| 125 // end was been reached before finding a nonspace character. | 125 // end was been reached before finding a nonspace character. |
| 126 template <class Iterator, class EndMark> | 126 template <class Iterator, class EndMark> |
| 127 inline bool AdvanceToNonspace(UnicodeCache* unicode_cache, | 127 inline bool AdvanceToNonspace(UnicodeCache* unicode_cache, |
| 128 Iterator* current, | 128 Iterator* current, |
| 129 EndMark end) { | 129 EndMark end) { |
| 130 while (*current != end) { | 130 while (*current != end) { |
| 131 if (!unicode_cache->IsWhiteSpace(**current)) return true; | 131 if (!unicode_cache->IsWhiteSpaceOrLineTerminator(**current)) return true; |
| 132 ++*current; | 132 ++*current; |
| 133 } | 133 } |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 // Parsing integers with radix 2, 4, 8, 16, 32. Assumes current != end. | 138 // Parsing integers with radix 2, 4, 8, 16, 32. Assumes current != end. |
| 139 template <int radix_log_2, class Iterator, class EndMark> | 139 template <int radix_log_2, class Iterator, class EndMark> |
| 140 double InternalStringToIntDouble(UnicodeCache* unicode_cache, | 140 double InternalStringToIntDouble(UnicodeCache* unicode_cache, |
| 141 Iterator current, | 141 Iterator current, |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 SLOW_ASSERT(buffer_pos < kBufferSize); | 695 SLOW_ASSERT(buffer_pos < kBufferSize); |
| 696 buffer[buffer_pos] = '\0'; | 696 buffer[buffer_pos] = '\0'; |
| 697 | 697 |
| 698 double converted = Strtod(Vector<const char>(buffer, buffer_pos), exponent); | 698 double converted = Strtod(Vector<const char>(buffer, buffer_pos), exponent); |
| 699 return (sign == NEGATIVE) ? -converted : converted; | 699 return (sign == NEGATIVE) ? -converted : converted; |
| 700 } | 700 } |
| 701 | 701 |
| 702 } } // namespace v8::internal | 702 } } // namespace v8::internal |
| 703 | 703 |
| 704 #endif // V8_CONVERSIONS_INL_H_ | 704 #endif // V8_CONVERSIONS_INL_H_ |
| OLD | NEW |