ixdtf/parsers/
grammar.rs
#[inline]
pub(crate) const fn is_a_key_leading_char(ch: u8) -> bool {
ch.is_ascii_lowercase() || ch == b'_'
}
#[inline]
pub(crate) const fn is_a_key_char(ch: u8) -> bool {
is_a_key_leading_char(ch) || ch.is_ascii_digit() || ch == b'-'
}
pub(crate) const fn is_annotation_value_component(ch: u8) -> bool {
ch.is_ascii_digit() || ch.is_ascii_alphabetic()
}
#[inline]
pub(crate) const fn is_tz_leading_char(ch: u8) -> bool {
ch.is_ascii_alphabetic() || ch == b'_' || ch == b'.'
}
#[inline]
pub(crate) const fn is_tz_char(ch: u8) -> bool {
is_tz_leading_char(ch) || ch.is_ascii_digit() || ch == b'-' || ch == b'+'
}
#[inline]
pub(crate) const fn is_tz_name_separator(ch: u8) -> bool {
ch == b'/'
}
#[inline]
pub(crate) const fn is_ascii_sign(ch: u8) -> bool {
ch == b'+' || ch == b'-'
}
#[inline]
pub(crate) const fn is_time_separator(ch: u8) -> bool {
ch == b':'
}
#[inline]
pub(crate) const fn is_time_designator(ch: u8) -> bool {
ch == b'T' || ch == b't'
}
#[inline]
pub(crate) const fn is_space(ch: u8) -> bool {
ch == b' '
}
#[inline]
pub(crate) const fn is_date_time_separator(ch: u8) -> bool {
is_time_designator(ch) || is_space(ch)
}
#[inline]
pub(crate) const fn is_utc_designator(ch: u8) -> bool {
ch == b'Z' || ch == b'z'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_duration_designator(ch: u8) -> bool {
ch == b'P' || ch == b'p'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_year_designator(ch: u8) -> bool {
ch == b'Y' || ch == b'y'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_month_designator(ch: u8) -> bool {
ch == b'M' || ch == b'm'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_week_designator(ch: u8) -> bool {
ch == b'W' || ch == b'w'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_day_designator(ch: u8) -> bool {
ch == b'D' || ch == b'd'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_hour_designator(ch: u8) -> bool {
ch == b'H' || ch == b'h'
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_minute_designator(ch: u8) -> bool {
is_month_designator(ch)
}
#[inline]
#[cfg(feature = "duration")]
pub(crate) const fn is_second_designator(ch: u8) -> bool {
ch == b'S' || ch == b's'
}
#[inline]
pub(crate) const fn is_decimal_separator(ch: u8) -> bool {
ch == b'.' || ch == b','
}
#[inline]
pub(crate) const fn is_annotation_open(ch: u8) -> bool {
ch == b'['
}
#[inline]
pub(crate) const fn is_annotation_close(ch: u8) -> bool {
ch == b']'
}
#[inline]
pub(crate) const fn is_critical_flag(ch: u8) -> bool {
ch == b'!'
}
#[inline]
pub(crate) const fn is_annotation_key_value_separator(ch: u8) -> bool {
ch == b'='
}
#[inline]
pub(crate) const fn is_hyphen(ch: u8) -> bool {
ch == b'-'
}