docs: private Number consumeTokenNumber(char c) throws JsonParserException {
      int start = index - 1;
      int end = index;
  
      boolean isDouble = false;
      while (isDigitCharacter(peekChar())) {
        char next = (char)advanceChar();
        isDouble = next == '.' || next == 'e' || next == 'E' || isDouble;
        end++;
      }
  
      String number = string.substring(start, end);
  
      try {
        if (isDouble) {
          // Special zero handling to match JSON spec. Leading zero is only allowed if next character is . or e
          if (number.charAt(0) == '0') {
            if (number.charAt(1) == '.') {
              if (number.length() == 2)
                throw createParseException(null, "Malformed number: " + number, true);
            } else if (number.charAt(1) != 'e' && number.charAt(1) != 'E')
              throw createParseException(null, "Malformed number: " + number, true);
          }
          if (number.charAt(0) == '-') {
            if (number.charAt(1) == '0') {
              if (number.charAt(2) == '.') {
                if (number.length() == 3)
                  throw createParseException(null, "Malformed number: " + number, true);
              } else if (number.charAt(2) != 'e' && number.charAt(2) != 'E')
                throw createParseException(null, "Malformed number: " + number, true);
            } else if (number.charAt(1) == '.') {
              throw createParseException(null, "Malformed number: " + number, true);
            }
          }
  
          return Double.parseDouble(number);
        }
  
        // Special zero handling to match JSON spec. No leading zeros allowed for integers.
        if (number.charAt(0) == '0') {
          if (number.length() == 1)
            return 0;
          throw createParseException(null, "Malformed number: " + number, true);
        }
        if (number.length() > 1 && number.charAt(0) == '-' && number.charAt(1) == '0') {
          if (number.length() == 2)
            return -0.0;
          throw createParseException(null, "Malformed number: " + number, true);
        }
  
        // HACK: Attempt to parse using the approximate best type for this
        int length = number.charAt(0) == '-' ? number.length() - 1 : number.length();
        if (length < 10) // 2 147 483 647
          return Integer.parseInt(number);
        if (length < 19) // 9 223 372 036 854 775 807
          return Long.parseLong(number);
        return new BigInteger(number);
      } catch (NumberFormatException e) {
        throw createParseException(e, "Malformed number: " + number, true);
      }
    }