Lines Matching defs:start

67       return ToASCIIString("CBOR: invalid start byte");
81 return ToASCIIString("CBOR: map start expected");
184 // Reads the start of a token with definitive size from |bytes|.
233 // Writes the start of a token with |type|. The |value| may indicate the size,
439 // (kInitialByteForEnvelope), plus the start byte for a BYTE_STRING with a 32
781 /* tag before token start: */ 1 +
782 /* token start: */ bytes_read;
1011 // |bytes| must start with the indefinite length array byte, so basically,
1039 // |bytes| must start with the indefinite length array byte, so basically,
1093 // We checked for the envelope start byte above, so the tokenizer
1541 void Parse(const Char* start, size_t length) {
1542 start_pos_ = start;
1543 const Char* end = start + length;
1545 ParseValue(start, end, &tokenEnd, 0);
1571 static bool ParseConstToken(const Char* start,
1576 while (start < end && *token != '\0' && *start++ == *token++) {
1580 *token_end = start;
1584 static bool ReadInt(const Char* start,
1588 if (start == end)
1590 bool has_leading_zero = '0' == *start;
1592 while (start < end && '0' <= *start && *start <= '9') {
1593 ++start;
1600 *token_end = start;
1604 static bool ParseNumberToken(const Char* start,
1609 if (start == end)
1611 Char c = *start;
1613 ++start;
1615 if (!ReadInt(start, end, &start, /*allow_leading_zeros=*/false))
1617 if (start == end) {
1618 *token_end = start;
1623 c = *start;
1625 ++start;
1626 if (!ReadInt(start, end, &start, /*allow_leading_zeros=*/true))
1628 if (start == end) {
1629 *token_end = start;
1632 c = *start;
1637 ++start;
1638 if (start == end)
1640 c = *start;
1642 ++start;
1643 if (start == end)
1646 if (!ReadInt(start, end, &start, /*allow_leading_zeros=*/true))
1650 *token_end = start;
1654 static bool ReadHexDigits(const Char* start,
1658 if (end - start < digits)
1661 Char c = *start++;
1666 *token_end = start;
1670 static bool ParseStringToken(const Char* start,
1673 while (start < end) {
1674 Char c = *start++;
1676 if (start == end)
1678 c = *start++;
1682 if (!ReadHexDigits(start, end, &start, 2))
1686 if (!ReadHexDigits(start, end, &start, 4))
1703 *token_end = start;
1710 static bool SkipComment(const Char* start,
1713 if (start == end)
1716 if (*start != '/' || start + 1 >= end)
1718 ++start;
1720 if (*start == '/') {
1722 for (++start; start < end; ++start) {
1723 if (*start == '\n' || *start == '\r') {
1724 *comment_end = start + 1;
1733 if (*start == '*') {
1736 for (++start; start < end; previous = *start++) {
1737 if (previous == '*' && *start == '/') {
1738 *comment_end = start + 1;
1755 static void SkipWhitespaceAndComments(const Char* start,
1758 while (start < end) {
1759 if (IsSpaceOrNewLine(*start)) {
1760 ++start;
1761 } else if (*start == '/') {
1763 if (!SkipComment(start, end, &comment_end))
1765 start = comment_end;
1770 *whitespace_end = start;
1773 static Token ParseToken(const Char* start,
1777 SkipWhitespaceAndComments(start, end, tokenStart);
1778 start = *tokenStart;
1780 if (start == end)
1783 switch (*start) {
1785 if (ParseConstToken(start, end, token_end, kNullString))
1789 if (ParseConstToken(start, end, token_end, kTrueString))
1793 if (ParseConstToken(start, end, token_end, kFalseString))
1797 *token_end = start + 1;
1800 *token_end = start + 1;
1803 *token_end = start + 1;
1806 *token_end = start + 1;
1809 *token_end = start + 1;
1812 *token_end = start + 1;
1825 if (ParseNumberToken(start, end, token_end))
1829 if (ParseStringToken(start + 1, end, token_end))
1847 static bool DecodeString(const Char* start,
1850 if (start == end)
1852 if (start > end)
1854 output->reserve(end - start);
1855 while (start < end) {
1856 uint16_t c = *start++;
1885 if (start + num_bytes_left > end)
1888 c = *start++;
1921 if (start == end)
1923 c = *start++;
1954 c = (HexToInt(*start) << 12) + (HexToInt(*(start + 1)) << 8) +
1955 (HexToInt(*(start + 2)) << 4) + HexToInt(*(start + 3));
1956 start += 4;
1966 void ParseValue(const Char* start,
1971 HandleError(Error::JSON_PARSER_STACK_LIMIT_EXCEEDED, start);
1976 Token token = ParseToken(start, end, &token_start, &token_end);
2019 start = token_end;
2020 token = ParseToken(start, end, &token_start, &token_end);
2022 ParseValue(start, end, &token_end, depth + 1);
2027 start = token_end;
2028 token = ParseToken(start, end, &token_start, &token_end);
2030 start = token_end;
2031 token = ParseToken(start, end, &token_start, &token_end);
2048 start = token_end;
2049 token = ParseToken(start, end, &token_start, &token_end);
2062 start = token_end;
2064 token = ParseToken(start, end, &token_start, &token_end);
2069 start = token_end;
2071 ParseValue(start, end, &token_end, depth + 1);
2074 start = token_end;
2078 token = ParseToken(start, end, &token_start, &token_end);
2080 start = token_end;
2081 token = ParseToken(start, end, &token_start, &token_end);