Module scan

Source
Expand description

Various scanning routines for the parser.

Enumsยง

CommentState ๐Ÿ”’

Functionsยง

char ๐Ÿ”’
Tries to consume exactly one given character.
colon_or_space ๐Ÿ”’
Consumes any number (including zero) of colon or spaces.
comment_2822 ๐Ÿ”’
Tries to consume an RFC2822 comment including preceding .
nanosecond ๐Ÿ”’
Tries to consume at least one digits as a fractional second. Returns the number of whole nanoseconds (0โ€“999,999,999).
nanosecond_fixed ๐Ÿ”’
Tries to consume a fixed number of digits as a fractional second. Returns the number of whole nanoseconds (0โ€“999,999,999).
number ๐Ÿ”’
Tries to parse the non-negative number from min to max digits.
short_month0 ๐Ÿ”’
Tries to parse the month index (0 through 11) with the first three ASCII letters.
short_or_long_month0 ๐Ÿ”’
Tries to parse the month index (0 through 11) with short or long month names. It prefers long month names to short month names when both are possible.
short_or_long_weekday ๐Ÿ”’
Tries to parse the weekday with short or long weekday names. It prefers long weekday names to short weekday names when both are possible.
short_weekday ๐Ÿ”’
Tries to parse the weekday with the first three ASCII letters.
space ๐Ÿ”’
Tries to consume one or more whitespace.
timezone_offset ๐Ÿ”’
Parse a timezone from s and return the offset in seconds.
timezone_offset_2822 ๐Ÿ”’
Same as timezone_offset but also allows for RFC 2822 legacy timezones. May return None which indicates an insufficient offset data (i.e. -0000). See RFC 2822 Section 4.3.