#include "src/temporal/temporal-parser.h"
#include <optional>
#include "src/base/bounds.h"
#include "src/objects/string-inl.h"
#include "src/strings/char-predicates-inl.h"
namespace v8::internal {
namespace {
inline constexpr bool IsTZLeadingChar(base::uc32 c) { … }
inline constexpr bool IsTZChar(base::uc32 c) { … }
inline constexpr bool IsDecimalSeparator(base::uc32 c) { … }
inline constexpr bool IsDateTimeSeparator(base::uc32 c) { … }
inline constexpr bool IsAsciiSign(base::uc32 c) { … }
inline constexpr bool IsSign(base::uc32 c) { … }
inline constexpr bool IsTimeZoneUTCOffsetSign(base::uc32 c) { … }
inline constexpr base::uc32 CanonicalSign(base::uc32 c) { … }
inline constexpr int32_t ToInt(base::uc32 c) { … }
template <typename Char>
bool HasTwoDigits(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanTwoDigitsExpectValue(base::Vector<Char> str, int32_t s,
int32_t expected, int32_t* out) { … }
template <typename Char>
int32_t ScanTwoDigitsExpectRange(base::Vector<Char> str, int32_t s, int32_t min,
int32_t max, int32_t* out) { … }
template <typename Char>
int32_t ScanTwoDigitsExpectZeroOrRange(base::Vector<Char> str, int32_t s,
int32_t min, int32_t max, int32_t* out) { … }
template <typename Char>
int32_t ScanHour(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanUnpaddedHour(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanMinuteSecond(base::Vector<Char> str, int32_t s, int32_t* out) { … }
#define SCAN_FORWARD(B, T, R) …
#define SCAN_EITHER_FORWARD(B, T1, T2, R) …
SCAN_FORWARD(…)
SCAN_FORWARD(…)
template <typename Char>
int32_t ScanTimeSecond(base::Vector<Char> str, int32_t s, int32_t* out) { … }
constexpr int kPowerOfTen[] = …;
template <typename Char>
int32_t ScanFractionalPart(base::Vector<Char> str, int32_t s, int32_t* out) { … }
SCAN_FORWARD(…)
template <typename Char>
int32_t ScanFraction(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanTimeFraction(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanTimeFraction(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeSpec(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeSpecSeparator(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanDateExtendedYear(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanDateFourDigitYear(base::Vector<Char> str, int32_t s, int32_t* out) { … }
SCAN_EITHER_FORWARD(…)
template <typename Char>
int32_t ScanDateMonth(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanDateDay(base::Vector<Char> str, int32_t s, int32_t* out) { … }
template <typename Char>
int32_t ScanDate(base::Vector<Char> str, int32_t s, ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanDateMonthWithThirtyOneDays(base::Vector<Char> str, int32_t s) { … }
SCAN_FORWARD(…)
SCAN_FORWARD(…)
SCAN_FORWARD(…)
SCAN_FORWARD(…)
template <typename Char>
int32_t ScanTimeZoneUTCOffsetFraction(base::Vector<Char> str, int32_t s,
int32_t* out) { … }
template <typename Char>
int32_t ScanTimeZoneNumericUTCOffset(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeZoneUTCOffset(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeZoneIANANameComponent(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanTimeZoneIANALegacyName(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanEtcGMTASCIISignUnpaddedHour(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanTimeZoneIANAName(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanTimeZoneUTCOffsetName(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanEtcGMTAsciiSignHour(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanTimeZoneIdentifier(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r);
template <typename Char>
int32_t ScanTimeZoneBracketedAnnotation(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeZoneOffsetRequired(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeZoneNameRequired(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeZone(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanValidMonthDay(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanDateSpecYearMonth(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r);
template <typename Char>
int32_t ScanTimeSpecWithOptionalTimeZoneNotAmbiguous(base::Vector<Char> str,
int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanCalendarNameComponent(base::Vector<Char> str, int32_t s) { … }
template <typename Char>
int32_t ScanCalendarName(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanCalendar(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanCalendarTime_L1(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanCalendarTime_L2(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanDateTime(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanDateSpecYearMonth(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanDateSpecMonthDay(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTimeZoneIdentifier(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanCalendarDateTime(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanCalendarDateTimeTimeRequired(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
template <typename Char>
int32_t ScanTemporalZonedDateTimeString(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
SCAN_FORWARD(…)
SCAN_EITHER_FORWARD(…)
template <typename Char>
int32_t ScanTemporalInstantString(base::Vector<Char> str, int32_t s,
ParsedISO8601Result* r) { … }
#define SATISIFY(T, R) …
#define IF_SATISFY_RETURN(T) …
#define SATISIFY_EITHER(T1, T2, T3, R) …
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
template <typename Char>
bool SatisfyCalendarTime(base::Vector<Char> str, ParsedISO8601Result* r) { … }
SATISIFY(…)
SATISIFY_EITHER(…)
SATISIFY_EITHER(…)
SATISIFY_EITHER(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
SATISIFY(…)
template <typename Char>
int32_t ScanDigits(base::Vector<Char> str, int32_t s, double* out) { … }
SCAN_FORWARD(DurationYears, Digits, double)
SCAN_FORWARD(DurationMonths, Digits, double)
SCAN_FORWARD(DurationWeeks, Digits, double)
SCAN_FORWARD(DurationDays, Digits, double)
SCAN_FORWARD(DurationWholeHours, Digits, double)
SCAN_FORWARD(DurationWholeMinutes, Digits, double)
SCAN_FORWARD(DurationWholeSeconds, Digits, double)
SCAN_FORWARD(…)
SCAN_FORWARD(…)
SCAN_FORWARD(…)
#define DURATION_WHOLE_FRACTION_DESIGNATOR(Name, name, d) …
DURATION_WHOLE_FRACTION_DESIGNATOR(…)
DURATION_WHOLE_FRACTION_DESIGNATOR(…)
DURATION_WHOLE_FRACTION_DESIGNATOR(…)
SCAN_FORWARD(…)
template <typename Char>
int32_t ScanDurationMinutesPart(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
template <typename Char>
int32_t ScanDurationHoursPart(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
template <typename Char>
int32_t ScanDurationTime(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
#define DURATION_AND_DESIGNATOR(Name, name, d) …
DURATION_AND_DESIGNATOR(…)
DURATION_AND_DESIGNATOR(…)
DURATION_AND_DESIGNATOR(…)
DURATION_AND_DESIGNATOR(…)
SCAN_FORWARD(…)
template <typename Char>
int32_t ScanDurationWeeksPart(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
template <typename Char>
int32_t ScanDurationMonthsPart(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
template <typename Char>
int32_t ScanDurationYearsPart(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
template <typename Char>
int32_t ScanDurationDate(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
template <typename Char>
int32_t ScanDuration(base::Vector<Char> str, int32_t s,
ParsedISO8601Duration* r) { … }
SCAN_FORWARD(…)
SATISIFY(…)
}
#define IMPL_PARSE_METHOD(R, NAME) …
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
IMPL_PARSE_METHOD(…)
}