Module grammar

Source
Expand description

This module contains a number of helper functions for writing parsers.

Ironically they are also needed when writing mail encoders/generators e.g. for checking if a part need special encoding.

Modules§

encoded_word
Grammar parts for encoded words (based on RFC 2047).

Functions§

is_any_whitespace
any whitespace (char::is_whitespace)
is_ascii
True if ch is us-ascii (i.e. <128)
is_ascii_vchar
True if ch is ascii and “visible”/“printable”.
is_atext
atext as defined by RFC 5322
is_ctext
ctext as defined by RFC 5322
is_ctl
Chack if it is a CTL char (based on RFC 822).
is_dtext
dtext as defined by RFC 5322
is_especial
Check if a char is especial (based on RFC …).
is_ftext
ftext as defined by RFC 5322
is_qtext
qtext as defined by RFC 5322
is_quotable
can be quoted in a quoted string (internalized) based on RFC … and RFC …
is_quoted_string
True if the given string is a quoted string.
is_space
True if ch is ' '
is_special
check if a char is a especial (based on RFC 5322)
is_token
Check if a string is an token (based on RFC …).
is_token_char
Check if a char is an token char (based on RFC 2045).
is_tspecial
check if a char is an tspecial (based on RFC 2045)
is_vchar
VCHAR as defined by RFC 5243
is_ws
WS as defined by RFC 5234