Lines Matching refs:current
57 // Get the current position in the builder.
160 bool SubStringEquals(Iterator* current, EndMark end, const char* substring) {
161 DCHECK(**current == *substring);
163 ++*current;
164 if (*current == end || **current != *substring) return false;
166 ++*current;
173 inline bool AdvanceToNonspace(Iterator* current, EndMark end) {
174 while (*current != end) {
175 if (!IsWhiteSpaceOrLineTerminator(**current)) return true;
176 ++*current;
181 // Parsing integers with radix 2, 4, 8, 16, 32. Assumes current != end.
183 double InternalStringToIntDouble(Iterator current, EndMark end, bool negative,
185 DCHECK(current != end);
188 while (*current == '0') {
189 ++current;
190 if (current == end) return SignedZero(negative);
203 if (*current >= '0' && *current < lim_0) {
204 digit = static_cast<char>(*current) - '0';
205 } else if (*current >= 'a' && *current < lim_a) {
206 digit = static_cast<char>(*current) - 'a' + 10;
207 } else if (*current >= 'A' && *current < lim_A) {
208 digit = static_cast<char>(*current) - 'A' + 10;
210 if (allow_trailing_junk || !AdvanceToNonspace(¤t, end)) {
235 ++current;
236 if (current == end || !isDigit(*current, radix)) break;
237 zero_tail = zero_tail && *current == '0';
241 if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
263 ++current;
264 } while (current != end);
358 void DetectRadixInternal(Char current, int length);
391 void StringToIntHelper<IsolateT>::DetectRadixInternal(Char current,
393 Char start = current;
397 if (!AdvanceToNonspace(¤t, end)) {
401 if (*current == '+') {
403 ++current;
404 if (current == end) {
408 } else if (*current == '-') {
409 ++current;
410 if (current == end) {
419 if (*current == '0') {
420 ++current;
421 if (current == end) return set_state(State::kZero);
422 if (*current == 'x' || *current == 'X') {
424 ++current;
425 if (current == end) return set_state(State::kJunk);
427 (*current == 'o' || *current == 'O')) {
429 ++current;
430 if (current == end) return set_state(State::kJunk);
432 (*current == 'b' || *current == 'B')) {
434 ++current;
435 if (current == end) return set_state(State::kJunk);
441 if (*current == '0') {
443 ++current;
444 if (current == end) return set_state(State::kZero);
445 if (*current == 'x' || *current == 'X') {
446 ++current;
447 if (current == end) return set_state(State::kJunk);
454 while (*current == '0') {
456 ++current;
457 if (current == end) return set_state(State::kZero);
460 if (!leading_zero_ && !isDigit(*current, radix_)) {
466 cursor_ = static_cast<int>(current - start);
476 Char current = start + cursor();
479 if (radix() == 10) return HandleBaseTenCase(current, end);
481 result_ = HandlePowerOfTwoCase(current, end);
485 return HandleGenericCase(current, end);
511 void HandleGenericCase(Char current, Char end);
514 double HandlePowerOfTwoCase(Char current, Char end) {
520 return InternalStringToIntDouble<1>(current, end, negative,
523 return InternalStringToIntDouble<2>(current, end, negative,
526 return InternalStringToIntDouble<3>(current, end, negative,
530 return InternalStringToIntDouble<4>(current, end, negative,
534 return InternalStringToIntDouble<5>(current, end, negative,
542 void HandleBaseTenCase(Char current, Char end) {
550 while (*current >= '0' && *current <= '9') {
555 buffer[buffer_pos++] = static_cast<char>(*current);
557 ++current;
558 if (current == end) break;
572 void NumberParseIntHelper::HandleGenericCase(Char current, Char end) {
588 // Parse the longest part of the string starting at {current}
594 if (*current >= '0' && *current < lim_0) {
595 d = *current - '0';
596 } else if (*current >= 'a' && *current < lim_a) {
597 d = *current - 'a' + 10;
598 } else if (*current >= 'A' && *current < lim_A) {
599 d = *current - 'A' + 10;
616 ++current;
617 if (current == end) {
625 if (!allow_trailing_junk() && AdvanceToNonspace(¤t, end)) {
633 // 1. current == end (other ops are not allowed), current != end.
634 // 2. *current - gets the current character in the sequence.
635 // 3. ++current (advances the position).
637 double InternalStringToDouble(Iterator current, EndMark end, int flags,
641 // 1. Each '++current' statement is followed by check for equality to 'end'.
642 // 2. If AdvanceToNonspace returned false then current == end.
643 // 3. If 'current' becomes be equal to 'end' the function returns or goes to
645 // 4. 'current' is not dereferenced after the 'parsing_done' label.
646 // 5. Code before 'parsing_done' may rely on 'current != end'.
647 if (!AdvanceToNonspace(¤t, end)) {
678 if (*current == '+') {
680 ++current;
681 if (current == end) return JunkStringValue();
683 } else if (*current == '-') {
684 ++current;
685 if (current == end) return JunkStringValue();
690 if (*current == kInfinityString[0]) {
691 if (!SubStringEquals(¤t, end, kInfinityString)) {
695 if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
704 if (*current == '0') {
705 ++current;
706 if (current == end) return SignedZero(sign == Sign::kNegative);
711 if ((flags & ALLOW_HEX) && (*current == 'x' || *current == 'X')) {
712 ++current;
713 if (current == end || !isDigit(*current, 16) || sign != Sign::kNone) {
717 return InternalStringToIntDouble<4>(current, end, false,
721 } else if ((flags & ALLOW_OCTAL) && (*current == 'o' || *current == 'O')) {
722 ++current;
723 if (current == end || !isDigit(*current, 8) || sign != Sign::kNone) {
727 return InternalStringToIntDouble<3>(current, end, false,
731 } else if ((flags & ALLOW_BINARY) && (*current == 'b' || *current == 'B')) {
732 ++current;
733 if (current == end || !isBinaryDigit(*current) || sign != Sign::kNone) {
737 return InternalStringToIntDouble<1>(current, end, false,
742 while (*current == '0') {
743 ++current;
744 if (current == end) return SignedZero(sign == Sign::kNegative);
751 while (*current >= '0' && *current <= '9') {
754 buffer[buffer_pos++] = static_cast<char>(*current);
759 nonzero_digit_dropped = nonzero_digit_dropped || *current != '0';
761 octal = octal && *current < '8';
762 ++current;
763 if (current == end) goto parsing_done;
770 if (*current == '.') {
774 ++current;
775 if (current == end) {
787 while (*current == '0') {
788 ++current;
789 if (current == end) return SignedZero(sign == Sign::kNegative);
796 while (*current >= '0' && *current <= '9') {
799 buffer[buffer_pos++] = static_cast<char>(*current);
804 nonzero_digit_dropped = nonzero_digit_dropped || *current != '0';
806 ++current;
807 if (current == end) goto parsing_done;
820 if (*current == 'e' || *current == 'E') {
822 ++current;
823 if (current == end) {
831 if (*current == '+' || *current == '-') {
832 exponent_sign = static_cast<char>(*current);
833 ++current;
834 if (current == end) {
843 if (current == end || *current < '0' || *current > '9') {
856 int digit = *current - '0';
863 ++current;
864 } while (current != end && *current >= '0' && *current <= '9');
869 if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
995 Char current = start + this->cursor();
997 current = accumulator_.Parse(current, end, this->radix());
1003 if (!this->allow_trailing_junk() && AdvanceToNonspace(¤t, end)) {